Discussion:
Making two requests
Hacxx Under
2018-10-24 09:21:38 UTC
Permalink
Hi,

I'm trying to use curl command line to send two requests. One is a post and
the second is a get. The problem is that they do not work.

Only this seems to work.
curl.exe --get --insecure "http://www.example.com"

I have read the documentation on the site and the manual in curl command
line but the best i got was

curl -d score=10 http://example.com/post.cgi --next
http://example.com/results.html

But nothing happens ( the %temp%>1.txt) returns empty

Any help on this subject?

Thanks
Hacxx Under
2018-10-24 13:08:07 UTC
Permalink
I have tested

curl.exe -d "param1=value1&param2=value2" -X POST http://127.0.0.1:81/data

And nothing happens. Also the latested DOS version of curl, wget, etc
are corrupted. When opening with WinRAR the application starts
blinking and when double clicking nothing happen.

Thanks
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-user
David Colter
2018-10-24 13:08:08 UTC
Permalink
Hello,
One is a post and the second is a get. The problem is that they do not work.
curl -d score=10 http://example.com/post.cgi <http://example.com/post.cgi> --next http://example.com/results.html <http://example.com/results.html>
Try turning the very helpful, verbose mode on, like:

curl -v -d score=10 http://example.com/post.cgi <http://example.com/post.cgi> --next http://example.com/results.html <http://example.com/results.html>

Two additional thoughts. You will need to:

1. add --get to the first request, and
2. specify the -d (data) with appropriate data in both requests.

Verbose mode output will help you debug and build the correct command.

David
Hacxx Under
2018-10-24 16:28:48 UTC
Permalink
Hi, Thanks for the reply.

Using the verbose mode (-v) doesn't change anything. The result was
and still is a empty line. No errors are visible - so - the query must
be correct nevertheless nothing show up in the server log.

I tested with the following line (removed <text> from your query
because "The syntax of the command is incorrect.")
curl -v -d score=10 http://example.com/post.cgi --next
http://example.com/results.html

Do you have more working query to test out?
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/
David Colter
2018-10-24 20:42:57 UTC
Permalink
Hi,
Post by Hacxx Under
Using the verbose mode (-v) doesn't change anything. The result was
and still is a empty line. No errors are visible - so - the query must
be correct nevertheless nothing show up in the server log.
Well then, it seems you have a problem. With -v, you should get a screen full of info that curl provides to tell about the request.

I tried:

curl -v http://www.google.com <http://www.google.com/> and got a bunch of lines (> 60) that ended with some html (in text) informing me that that page had been redirected to another.

If you are getting a blank line, something else might be failing.

David

Loading...