protected HttpPost ImageSetFileControlP( string imageSetId, string filePath, string ControlStr, Dictionary <string, string> options) { string postUrl = urlImageSet(imageSetId); Dictionary <string, string> headers = getCommonHeader(null); HttpForm form = new HttpForm(); byte[] bytes = Functions.getFileBytes(filePath); form.AddBinary(ControlStr, bytes, "productAIService.csv"); HttpPost hp = new HttpPost(postUrl, headers, form); return(hp); }
protected HttpPost SubmitFileToSearchP(string serviceType, string serviceID, byte[] fileBytes, Dictionary <string, string> options) { string url = urlSearch(serviceType, serviceID); Dictionary <string, string> headers = getCommonHeader(options); HttpForm form = new HttpForm(); foreach (var param in options) { form.AddField(param.Key, param.Value); } form.AddBinary("search", fileBytes, "productAIService.jpg", "image/jpegcv"); HttpPost hp = new HttpPost(url, headers, form); return(hp); }