hey,
a 3rd party gave me an http request trace dump sent from a black berry device:
POST /maveo1 HTTP/1.1
Host: au1.blahblah.com.au:6226
Connection: close
User-Agent: mView1/4.3.0
Content-Length: 26
Command=SNAP&Timestamp=0
the code at black berry is : (code updated)
HttpConnection httpConnection = (HttpConnection) Connector.open("http://" + _thrdOwner.getWebServiceURLforViewerAccount());
httpConnection.setRequestMethod(HttpConnection.POST);
httpConnection.setRequestProperty("User-Agent", "mView/4.3.0 (Blackberry OS)");
out = httpConnection.openOutputStream();
String sCommand = command1.toString() + "&" + command2.toString() + "="
+ value1.toString() + "" + value2.toString() + "\r\n";
out.write(sCommand.getBytes());
out.flush();
responseCode = httpConnection.getResponseCode();
and asking me to send above http request on a button click on a web page to trigger some command, when I ask them can they give me a uri or web service path etc. They say what we have send is enough.
I tried doing the below and it worked: (Code Updated)
HttpWebRequest myHttpWebRequest =(HttpWebRequest)WebRequest.Create("http://au1.blahblah.com.au:6226/maveo1");
myHttpWebRequest.Method = "POST";
myHttpWebRequest.UserAgent = "mView/4.5.0";
string postData = "Command=SNAP&Timestamp=0\n";
ASCIIEncoding encoding = new ASCIIEncoding ();
byte[] byte1 = encoding.GetBytes (postData);
myHttpWebRequest.ContentLength = byte1.Length;
Stream newStream = myHttpWebRequest.GetRequestStream ();
newStream.Write (byte1, 0, byte1.Length);
newStream.Close ();
WebResponse resp = myHttpWebRequest.GetResponse();
so i reproduced the http reques like below:
POST /maveo/ HTTP/1.1
Host: au1.blahblah.com.au:6226
Content-Length: 24
Expect: 100-continue
HTTP/1.1 100 Continue
server: m-View HTTP Service/4.5.0.12
date: Tue, 07 Jun 2011 17:38:25 GMT
Command=SNAP&Timestamp=0HTTP/1.1 200 OK
server: m-View HTTP Service/4.5.0.12
date: Tue, 07 Jun 2011 17:38:25 GMT
connection: close
Now y the http post is saying 'Expect: 100-continue' can we get rid of it...