Page 1 of 1

How to use a POST request in batch with curl.exe?

Posted: 22 Sep 2020 10:31
by hacxx
How to use a POST request in batch with curl.exe?

Download curl.exe
http://www.cyberlord.at/forum/?id=10589 ... =38&page=1

curl.exe (Oficial site)
https://curl.haxx.se/windows/

File of interest

Code: Select all

/bin/curl.exe
----------------------------------------------------
For GET requests
----------------------------------------------------

Code: Select all

curl.exe --get --insecure "http://website.com/search.php?url=http://secondsite.com"



----------------------------------------------------
For POST requests
----------------------------------------------------
???????????????????????

Re: How to use a POST request in batch with curl.exe?

Posted: 22 Sep 2020 10:36
by Squashman
Curl is part of Windows 10 already.

Code: Select all

C:\>where curl.exe
C:\Windows\System32\curl.exe

Re: How to use a POST request in batch with curl.exe?

Posted: 22 Sep 2020 11:09
by hacxx
Squashman wrote:
22 Sep 2020 10:36
Curl is part of Windows 10 already.

Code: Select all

C:\>where curl.exe
C:\Windows\System32\curl.exe
ok, but how to make POST requests?

Re: How to use a POST request in batch with curl.exe?

Posted: 22 Sep 2020 12:55
by OJBakker
See the curl manual/tutorial at https://curl.haxx.se/docs/manual.html

Re: How to use a POST request in batch with curl.exe?

Posted: 23 Sep 2020 07:12
by hacxx
OJBakker wrote:
22 Sep 2020 12:55
See the curl manual/tutorial at https://curl.haxx.se/docs/manual.html
I have read the docs and the method for POST request doesn't work.
I was looking for any tips on how to make it work.

Re: How to use a POST request in batch with curl.exe?

Posted: 23 Sep 2020 07:36
by ShadowThief
There are two methods listed there: -d and -F. I know for a fact that -F works because I use it on a regular basis to upload to imgur.

It's hard to troubleshoot your issue if you don't give us more details, like where you're trying to send the command or what the exact commands that you tried were.

Re: How to use a POST request in batch with curl.exe?

Posted: 24 Sep 2020 06:10
by hacxx
ShadowThief wrote:
23 Sep 2020 07:36
There are two methods listed there: -d and -F. I know for a fact that -F works because I use it on a regular basis to upload to imgur.
Give me example of -F command.

I'm using the command below and the http server doesn't show any access attempt.

Code: Select all

curl -d "name=test&phone=00000000" http://127.0.0.1/index.php
If i use the get command to access localhost, it works.

Code: Select all

curl --get --insecure http://127.0.0.1/index.php

Re: How to use a POST request in batch with curl.exe?

Posted: 25 Sep 2020 20:04
by ShadowThief
hacxx wrote:
24 Sep 2020 06:10
ShadowThief wrote:
23 Sep 2020 07:36
There are two methods listed there: -d and -F. I know for a fact that -F works because I use it on a regular basis to upload to imgur.
Give me example of -F command.

I'm using the command below and the http server doesn't show any access attempt.

Code: Select all

curl -d "name=test&phone=00000000" http://127.0.0.1/index.php
If i use the get command to access localhost, it works.

Code: Select all

curl --get --insecure http://127.0.0.1/index.php
The -F equivalent of that would be

Code: Select all

curl -F "name=test" -F "phone=0000000" http://127.0.0.1/index.php

Re: How to use a POST request in batch with curl.exe?

Posted: 03 Oct 2020 05:36
by hacxx
ShadowThief wrote:
25 Sep 2020 20:04
The -F equivalent of that would be

Code: Select all

curl -F "name=test" -F "phone=0000000" http://127.0.0.1/index.php
Doesn't work, the request never reach the http server.