How to take a photo and send to HTTP POST request with Android?

This link should be more than sufficient for clicking, saving and getting path of an image: Capture Images This is the class i wrote for uploading images via HTTP POST: public class MultipartServer { private static final String TAG = “MultipartServer”; private static String crlf = “\r\n”; private static String twoHyphens = “–“; private static … Read more

IIS 7.5, Web Service and HTTP 405 error

After hours of struggling, this is final solution that helped me (tested from fiddler): On IIS 7.5 -> YourWebsite -> Handler Mappings Choose “Add module mapping” option on the right side of the panel In “Request path” field enter *.wsdl In “Module” field enter “ProtocolSupportModule” Click on “Request restrictions” and go to Verbs tab Enter … Read more

Submit pdf form fields to a HTTP POST request

doc.submitForm(url, false); or doc.submitForm( url, null, null, null, null, null, null, null, null, null null, null, null, null, null, “HTML” ); submitForm actually takes 23 different parameters, the above is only using 16 of them. And if I miscounted, I’m trying to use the cSubmitAs parameter. This from the JavaScript API reference, which can be … Read more

Using HttpWebRequest to POST data/upload image using multipart/form-data

I finally got it with the following code … var boundary = “————————” + DateTime.Now.Ticks; var newLine = Environment.NewLine; var propFormat = “–” + boundary + newLine + “Content-Disposition: form-data; name=\”{0}\”” + newLine + newLine + “{1}” + newLine; var fileHeaderFormat = “–” + boundary + newLine + “Content-Disposition: form-data; name=\”{0}\”; filename=\”{1}\”” + newLine; var … Read more

Sending Files using HTTP POST in c# [closed]

You can try the following code: public void PostMultipleFiles(string url, string[] files) { string boundary = “—————————-” + DateTime.Now.Ticks.ToString(“x”); HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); httpWebRequest.ContentType = “multipart/form-data; boundary=” + boundary; httpWebRequest.Method = “POST”; httpWebRequest.KeepAlive = true; httpWebRequest.Credentials = System.Net.CredentialCache.DefaultCredentials; Stream memStream = new System.IO.MemoryStream(); byte[] boundarybytes =System.Text.Encoding.ASCII.GetBytes(“\r\n–” + boundary +”\r\n”); string formdataTemplate = “\r\n–” + boundary … Read more

How to use getJSON, sending data with post method?

The $.getJSON() method does an HTTP GET and not POST. You need to use $.post() $.post(url, dataToBeSent, function(data, textStatus) { //data contains the JSON object //textStatus contains the status: success, error, etc }, “json”); In that call, dataToBeSent could be anything you want, although if are sending the contents of a an html form, you … Read more

How to Get the HTTP Post data in C#?

This code will list out all the form variables that are being sent in a POST. This way you can see if you have the proper names of the post values. string[] keys = Request.Form.AllKeys; for (int i= 0; i < keys.Length; i++) { Response.Write(keys[i] + “: ” + Request.Form[keys[i]] + “<br>”); }