0

I am using this code http://stunningco.de/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/ to send an image to my web server the code works fine but i want to be able to send some aditional parameters.

How can i send them , i tried constructing the url request like this http://www.mywebserver.com/postdata?param1=somevalue&param2=somevalue but the web server never reconisez them.

Thanks.

4

1 に答える 1

0

I don't know how did you program your custom server, but you passed the additional parameters the right way (via GET, not POST).

If you did it from scratch, by reading the HTTP protocol packets and interpreting them manually, then you'll have your GET parameters just after the requested URL at the first line, and will have to split the url by first using the '?' character to split the url from the parameters, then the '&' to split the different parameters into an array, and then split each parameter using the '=' character into a key and a value.

If that's not the case and used some kind of pyhon/Java/VB.NET library, please tell us which one..

于 2012-04-26T07:02:06.853 に答える