Exemplo n.º 1
0
        protected HttpPost SubmitFormToSearchP(string serviceType, string serviceID,
                                               string PictureUrl, Dictionary <string, string> options)
        {
            string searchUrl = urlSearch(serviceType, serviceID);
            Dictionary <string, string> parameters = new Dictionary <string, string>(options);

            parameters.Add("url", PictureUrl);
            Dictionary <string, string> headers = getCommonHeader(parameters);
            UrlEncodeForm form = new UrlEncodeForm();

            foreach (var param in parameters)
            {
                form.AddField(param.Key, param.Value);
            }
            HttpPost hp = new HttpPost(searchUrl, headers, form);

            return(hp);
        }
Exemplo n.º 2
0
        protected HttpPost AddImageToImageSetP(string imageSetId, string imageUrl,
                                               Dictionary <string, string> options)
        {
            string postUrl = urlImageSet(imageSetId);
            Dictionary <string, string> parameters =
                new Dictionary <string, string>(options);

            parameters.Add("image_url", imageUrl);
            Dictionary <string, string> headers = getCommonHeader(parameters);
            UrlEncodeForm form = new UrlEncodeForm();

            foreach (var param in parameters)
            {
                form.AddField(param.Key, param.Value);
            }
            HttpPost hp = new HttpPost(postUrl, headers, form);

            return(hp);
        }