Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help with HttpPut  RSS feed

 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my code which works


But I want to set the query params like below and it not working. Parameters are going to the servlet. Please help




Also how do I send an xml in request body for the same PUT request.

Thanks for the help!!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "is not working" mean? What happens, and how is that different from what you were expecting?

You would send the XML as another named parameter.
 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the parameters are null in the servlet when I use the below code

Any help..
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would use TCPMON or SOAPui on the client side to see exactly what your client request contains.

Bill
 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Willaim. Is this the expected behavior of HttpPut API to not send the parameters using BasicNamevaluePair ..?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hrithik khurana wrote:Thanks Willaim. Is this the expected behavior of HttpPut API to not send the parameters using BasicNamevaluePair ..?


I have never used HttpPut, why ask me - what does the published API say?

Have you actually tried my suggestion to look at what is being sent?

Bill
 
Kishen Singh Punjabi
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Bill, I have tried to check the param values at the client side and found them to be null.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API for version 4.3 here say that this constructor for DefaultHttpClient is deprecated.

Which version of the toolkit are you using?

Bill


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!