hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Ament (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCLIENT-809) Not sure the proper way to use HttpParams in HttpGet/Post
Date Mon, 01 Dec 2008 00:44:46 GMT
Not sure the proper way to use HttpParams in HttpGet/Post
---------------------------------------------------------

                 Key: HTTPCLIENT-809
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-809
             Project: HttpComponents HttpClient
          Issue Type: Question
          Components: Documentation
    Affects Versions: 4.0 Beta 1
         Environment: OpenSuSe 11 2.6.25
Java 1.6

            Reporter: John Ament
            Priority: Minor


I believe I'm not sure how to use HttpParams and HttpPost/Get Properly.

I have the following code:

String url = HttpUtils.addAppKey(Endpoints.POST_MESSAGE,config.getAppKey());
HttpClient client = super.verify(username, password);
HttpParams params = new BasicHttpParams();
params = params.setParameter("note_to", recipient).setParameter("note_body", body);
HttpPost post = new HttpPost(url);
post.setParams(params);
HttpResponse response =  client.execute(request);
StatusLine statusLine = response.getStatusLine();

Now, everytime I use HttpPost I get a 404 not found error (this is verified by inspecting
the statusline object).  If I do a similar request with get, it works as expected (405 method
not supported if i'm using the wrong method, or successful if it was supported).

I've checked, and a similar message with the 3.x client works fine.  The main reason I'm using
4.x is that one of my targeted platforms is android, and it uses the 4.x client in its libraries.
Any ideas what I'm doing wrong?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message