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

POST method with JSON data #424

Open
n0n3mi1y opened this issue Jul 11, 2022 · 10 comments
Open

POST method with JSON data #424

n0n3mi1y opened this issue Jul 11, 2022 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@n0n3mi1y
Copy link

Can i send a post request with json postData?

@ngosang ngosang added the enhancement New feature or request label Jul 30, 2022
@ngosang ngosang changed the title Json poat POST method with JSON data Jul 30, 2022
@ngosang
Copy link
Member

ngosang commented Jul 30, 2022

No sorry. We have some limitations with Puppeteer + Firefox. If we change the technology it could be implemented.

@carcabot
Copy link

carcabot commented Feb 10, 2023

Can be this a potentialy solution ?

driver.execute_script(""""return fetch(url, {method:"POST",
... options})"""") 

@aprilahijriyan
Copy link

For everyone who wants to send JSON requests, I created a module for that. Please try selenium-fetch

@carcabot
Copy link

carcabot commented Mar 9, 2023

Are you able to create a pull request with this module?

@Zelak312
Copy link

I also cooked something of my own to be able to send JSON requests and also passing Headers with FlareSolverr. compared to selenium-fetch, mine the request is actually sent by FlareSolverr and it's not a fetch.

It uses mitmproxy so you spin up FlareSolverr as usual but also the proxy server. When doing a request with FlareSolverr you just proxy it throught the proxy server and follow a special convention for Get or Post for setting headers and send json Post data. The proxy server essentially intercepts the request and modifies the content in flight before it reaches the actual url.

flaresolverr-mitm-proxy

I haven't had time to fully test it but it seemed to work nicely with the few test I made.
The code was made quickly as well so it's messy and it's still in a BETA phase as it is experimental but Pull request are welcomed. There is also a docker container and a docker compose example.

@DRSDavidSoft
Copy link
Contributor

@Zelak312 It's a great idea, also the fact that since you're using mitmproxy, you can set it to use an upstream proxy as well as sending custom headers, or doing any modifications that might be needed.

Great job for the idea! 👍🏻

@carcabot
Copy link

Great improvement, thanks.

@xtermed
Copy link

xtermed commented Dec 19, 2023

I cannot believe that all the valid, legitimate uses of MITMProxy slipped my mind. Really a powerhouse of a tool. Good thinking on that.

@WankkoRee
Copy link

#998 is available?

@jjhesk
Copy link

jjhesk commented May 15, 2024

nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants