Solved

httpcall post method

Posted on 2007-03-26
9
351 Views
Last Modified: 2008-01-09
hi all,

i am using apache httpcall jar. i can send param pairs with post method. but how can i send without param names, just value. i mean i would like to send just this 'deneme' string with text context header via post method.

thanks...
0
Comment
Question by:ysnky
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 23

Expert Comment

by:Ajay-Singh
Comment Utility
you can mention that in the URL, something like

/url?deneme
0
 
LVL 11

Expert Comment

by:Manish
Comment Utility
Why you dont want to send name?
You can use same name and value
deneme=deneme
0
 
LVL 11

Expert Comment

by:Manish
Comment Utility
I am wondering how anybody can get value without name? Is it possible?
0
 
LVL 23

Expert Comment

by:Ajay-Singh
Comment Utility
>  Is it possible?

Partly Yes. You would get the value sent as key in the servlet request, with no value
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 92

Expert Comment

by:objects
Comment Utility
you could get the value by accessing the query string directly

String value = request.getQueryString();
0
 
LVL 9

Author Comment

by:ysnky
Comment Utility
i mention about http post call via apache httpcall library.

HttpClient client = new HttpClient();
PostMethod method  = new PostMethod();

like this but i would like to set to the body not a parameter.
method.addParameter(httpParams[i].paramName, httpParams[i].paramValue);

>>Why you dont want to send name?
because the other side looks like the whole body not a parameter. and i cant change this.

0
 
LVL 30

Expert Comment

by:mayankeagle
Comment Utility
>> like this but i would like to set to the body not a parameter.

You can add a parameter to the request using addParameter  () - what do you mean you would like to set it to the body and not a parameter? It does add a parameter to the POST body:

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/PostMethod.html#addParameter(java.lang.String,%20java.lang.String)
0
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
Comment Utility
try:

method.setRequestEntity(new StringRequestEntity(value, contentType, charset));
0
 
LVL 9

Author Comment

by:ysnky
Comment Utility
thanks guys...
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
count11 challenge 6 47
What is JNDI datasource in spring 1 36
Image decoding from Camera 3 42
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now