Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
hacxx
- Posts: 57
- Joined: 09 Apr 2015 13:18
#1
Post
by hacxx » 22 Sep 2020 10:31
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
----------------------------------------------------
For GET requests
----------------------------------------------------
Code: Select all
curl.exe --get --insecure "http://website.com/search.php?url=http://secondsite.com"
----------------------------------------------------
For POST requests
----------------------------------------------------
???????????????????????
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#2
Post
by Squashman » 22 Sep 2020 10:36
Curl is part of Windows 10 already.
Code: Select all
C:\>where curl.exe
C:\Windows\System32\curl.exe
-
hacxx
- Posts: 57
- Joined: 09 Apr 2015 13:18
#3
Post
by hacxx » 22 Sep 2020 11:09
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?
-
hacxx
- Posts: 57
- Joined: 09 Apr 2015 13:18
#5
Post
by hacxx » 23 Sep 2020 07:12
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.
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#6
Post
by ShadowThief » 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.
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.
-
hacxx
- Posts: 57
- Joined: 09 Apr 2015 13:18
#7
Post
by hacxx » 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
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#8
Post
by ShadowThief » 25 Sep 2020 20:04
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
-
hacxx
- Posts: 57
- Joined: 09 Apr 2015 13:18
#9
Post
by hacxx » 03 Oct 2020 05:36
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.