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
-~----------~----~----~----~------~----~------~--~---

Reply via email to