Is HttpClient suitable for the following task?

View: New views
2 Messages — Rating Filter:   Alert me  

Is HttpClient suitable for the following task?

by yccheok :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I try to talk to a server, by telneting to it, and send the following command through telnet terminal :




POST /%5bvUpJYKw4QvGRMBmhATUxRwv4JrU9aDnwNEuangVyy6OuHxi2YiY=%5dImage? HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 164

[SORT]=0,1,0,10,5,0,KL,0&[FIELD]=33,38,51,58,68,88,78,98,99,101,56,57,69,70,71,72,89,90,91,92,59,60,61,62,79,80,81,82&[LIST]=1155.KL,1295.KL,7191.KL,0097.KL,2267.KL



This works very fine. Now, I wish I can use HttpClient, to talk to the server, as I use telnet to talk to the server. The reason I wish to use HttpClient, instead of using raw TCP socket, is because HttpClient does support NTLM.

However, when I use POST method with NameValuePair :

new NameValuePair("[SORT]", "0,1,0,10,5,0,KL,0")

The request will become URL encoded. The server doesn't understand URL encoded request.

%5BSORT%5D: 0%2C1%2C0%2C10%2C5%2C0%2CKL%2C0

Is there any way I can avoid this?

Thanks and Regards
Yan Cheng Cheok


     


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@...
For additional commands, e-mail: httpclient-users-help@...


Re: Is HttpClient suitable for the following task?

by olegk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yan Cheng Cheok wrote:

> I try to talk to a server, by telneting to it, and send the following command through telnet terminal :
>
>
>
>
> POST /%5bvUpJYKw4QvGRMBmhATUxRwv4JrU9aDnwNEuangVyy6OuHxi2YiY=%5dImage? HTTP/1.1
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 164
>
> [SORT]=0,1,0,10,5,0,KL,0&[FIELD]=33,38,51,58,68,88,78,98,99,101,56,57,69,70,71,72,89,90,91,92,59,60,61,62,79,80,81,82&[LIST]=1155.KL,1295.KL,7191.KL,0097.KL,2267.KL
>
>
>
> This works very fine. Now, I wish I can use HttpClient, to talk to the server, as I use telnet to talk to the server. The reason I wish to use HttpClient, instead of using raw TCP socket, is because HttpClient does support NTLM.
>
> However, when I use POST method with NameValuePair :
>
> new NameValuePair("[SORT]", "0,1,0,10,5,0,KL,0")
>
> The request will become URL encoded. The server doesn't understand URL encoded request.
>
> %5BSORT%5D: 0%2C1%2C0%2C10%2C5%2C0%2CKL%2C0
>
> Is there any way I can avoid this?
>
> Thanks and Regards
> Yan Cheng Cheok
>
>

Yes, there is. See my previous post.

Oleg


>      
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@...
> For additional commands, e-mail: httpclient-users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@...
For additional commands, e-mail: httpclient-users-help@...