projectdiscovery / httpx

httpx is a fast and multi-purpose HTTP toolkit that allows running multiple probes using the retryablehttp library.
https://docs.projectdiscovery.io/tools/httpx
MIT License
7.75k stars 843 forks source link

httpx doesn't auto change request method #1864

Closed Arrnitage closed 3 months ago

Arrnitage commented 3 months ago

httpx version:

httpx -version

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

        projectdiscovery.io

[INF] Current Version: v1.6.7

Current Behavior:

I'm trying to send POST request ,but httpx send a GET request

httpx -u http://127.0.0.1:8888 -path /test/for/example -body 'test=body' -debug

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

        projectdiscovery.io

[INF] Current httpx version v1.6.7 (latest)
[WRN] UI Dashboard is disabled, Use -dashboard option to enable
[INF] Dumped HTTP request for https://127.0.0.1:8888/test/for/example

GET /test/for/example HTTP/1.1
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Debian; Linux i686; rv:125.0) Gecko/20100101 Firefox/125.0
Content-Length: 9
Accept-Charset: utf-8
Accept-Encoding: gzip

test=body
[INF] Dumped HTTP request for http://127.0.0.1:8888/test/for/example

GET /test/for/example HTTP/1.1
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Content-Length: 9
Accept-Charset: utf-8
Accept-Encoding: gzip

test=body
[INF] Dumped HTTP response for http://127.0.0.1:8888/test/for/example

HTTP/1.1 404 Not Found
Connection: close
Content-Length: 19
Content-Type: text/plain; charset=utf-8
Date: Fri, 09 Aug 2024 14:17:11 GMT
X-Content-Type-Options: nosniff

404 page not found
http://127.0.0.1:8888/test/for/example

Expected Behavior:

Steps To Reproduce:

Anything else: