Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Setting up a get request but sending out a post request #388

Closed
RachelAlucard opened this issue Sep 21, 2024 · 3 comments
Closed

[BUG] Setting up a get request but sending out a post request #388

RachelAlucard opened this issue Sep 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@RachelAlucard
Copy link

RachelAlucard commented Sep 21, 2024

Describe the bug
I compared the use with the requests library. While also using the get method to initiate a request with a request body, the curl_cffi library actually initiates a post request。The code is as follows:

import requests
from curl_cffi import requests as request

if __name__ == "__main__":
    url = "http://127.0.0.1:9999/version"
    # use curl_cffi
    resp = request.get(url, params={"start": 0}, data={"s": "dsds"}, timeout=5)
    resp = request.get(url, params={"start": 0}, json={"s": "dsds"}, timeout=5)
    # use requests
    resp = requests.get(url, params={"start": 0}, data={"s": "dsds"}, timeout=5)
    resp = requests.get(url, params={"start": 0}, json={"s": "dsds"}, timeout=5)

Versions

  • OS: Windows 10 Enterprise LTSC 21H2
  • curl_cffi 0.7.1
  • python 3.12.6
  • requests 2.32.3

Additional context
The server is a simple server written using golang's gin. In addition to that, get requests sent to me locally using curl_cffi are not captured by fiddler, but requests sent to me locally by the requests library are captured by fiddler.
Snipaste_2024-09-21_12-20-50
Snipaste_2024-09-21_12-22-57

@RachelAlucard RachelAlucard added the bug Something isn't working label Sep 21, 2024
@RachelAlucard
Copy link
Author

RachelAlucard commented Sep 21, 2024

I found that if I add a proxy to the curl_cffi request and set the value to the port that fiddler listens on, fiddler captures the curl_cffi request correctly. But why does the requests library not need to be configured with a proxy for fiddler to capture the request correctly?

@perklet
Copy link
Collaborator

perklet commented Sep 23, 2024

This has been fixed in 0cf03fe, please wait for the new release. As for the capturing issue, it's probably because of the interfaces.

@lexiforest
Copy link
Owner

Released in 0.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants