The examples that Guillaume points you to cover most of what you want to do in a POST. What they don't cover is multipart mime messages and setting mime types. With "application/octet" as the mime type you should be ok with the examples. Otherwise, do have a look at HttpMime.
On Nov 23, 12:33 pm, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > http://hc.apache.org/httpcomponents-client/examples.html > > On Nov 22, 3:37 pm, fala70 <[EMAIL PROTECTED]> wrote: > > > Hi, I've a problem to translate follow code to org.apache.http.*; > > > OutputStream pos = new OutputStream(); > > pos.writeShort(Const.INVOCATION_CODE); > > pos.writeInt(requestId); > > pos.writeString(nickname); > > pos.writeString(password); > > > conn = (HttpConnection) Connector.open(url, > > Connector.READ_WRITE); > > conn.setRequestMethod(HttpConnection.POST); > > conn.setRequestProperty("Content-Type", "application/octet- > > stream"); > > conn.setRequestProperty("Accept", "application/octet-stream"); > > > if(sessionCookie == null) > > { > > conn.setRequestProperty("version", "???"); > > } > > else > > { > > conn.setRequestProperty("cookie", sessionCookie); > > } > > > // Getting the output stream may flush the headers > > os = conn.openDataOutputStream(); > > os.write(pos.getBytes()); > > os.close(); > > > start connection I must use : > > HttpClient conn = new DefaultHttpClient(); > > HttpPost httppost = new HttpPost(url); > > > but I've difficult to understand what must I use to set the request > > proprieties (setRequestProperty) and use an OutputStream to send my > > requests > > > thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

