How to post parameters with thttprequest to a form by the post method?

One Star

How to post parameters with thttprequest to a form by the post method?

Hi,
I would like to fill a form with the thttprequest component.
First step : i take the data in my database.
second step : I transform the data in a file. I can have sevral rows in the file.
Third step : I want to send the date with the thttprequest component in a form with the post method.
When i look in the forum, i just find, put your data in a file and it's ok. But i try everything, xml file, csv file, xml file with only one row, thttprequest configure with headers, but nothing works.
Could you help to find what i'm doing wrong.
How do i have to configure my file to send the data to the form ?
Thanks in advance,
Thibault
Moderator

Re: How to post parameters with thttprequest to a form by the post method?

Hi,
In a GET request, the parameters are sent as part of the URL.
In a POST request, the parameters are sent as a body of the response, after the headers.
To do a POST with Http URL Connection, you need to write the parameters to the connection after you have opened the connection.
for exmaple:
for get method:
set the url like :
http://example.com/index.php?param1=a&param2=b&param3=c
for post method, set the header table like:
header key:value
Content-LengthSmiley Tonguearam1=a&param2=b&param3=c

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: How to post parameters with thttprequest to a form by the post method?

Hi,
Thanks for your answer.
I still have a problem.
I try your solution (You can see it on the picture) but it doesn't work for me.
Maybe i'm not writing the parameters with the good syntax.
I try with the parameters in a txt file but it does nothing again.
I try with an xml file.
Could you look at the picture or at the submited files to help me to find the good syntax.
Thanks in advance for your help.
Thibault
One Star

Re: How to post parameters with thttprequest to a form by the post method?

Hi
I have the same problem. I need send a POST but in Headers don't know what is the sintax.
I tried with Header key = "Content-Length" and value = "value1=1020-1&value2=csmdefc" but i get the following error:
Starting job http_request at 10:27 11/04/2014.
connecting to socket on port 3670
connected
403 FORBIDDEN
disconnected
Seventeen Stars

Re: How to post parameters with thttprequest to a form by the post method?

Content-Length as key expect an integer value and not another key-value pair.
Why do you want to send the parameter Content-Length? Usually this attribute is part of the response!