You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "John Ament (JIRA)" <ji...@apache.org> on 2008/12/01 01:44:46 UTC

[jira] Created: (HTTPCLIENT-809) Not sure the proper way to use HttpParams in HttpGet/Post

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


[jira] Resolved: (HTTPCLIENT-809) Not sure the proper way to use HttpParams in HttpGet/Post

Posted by "Ortwin Glück (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ortwin Glück resolved HTTPCLIENT-809.
-------------------------------------

    Resolution: Incomplete

The submitted code is incomplete: definition of the variable request is missing. Please submit runnable code and reopen.

> 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
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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


[jira] Commented: (HTTPCLIENT-809) Not sure the proper way to use HttpParams in HttpGet/Post

Posted by "Ortwin Glück (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651938#action_12651938 ] 

Ortwin Glück commented on HTTPCLIENT-809:
-----------------------------------------

Actually, don't reopen unless this is clearly a bug. Please use the mailing lists for questions.

> 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
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> 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