Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending data in GET request Python

I know that it is not an advisable solution to use GET however I am not in control of how this server works and have very little experience with requests.

I'm looking to add a dictionary via a GET request and was told that the server had been set up to accept this but I'm not sure how that works. I have tried using

import requests
r = request.get('www.url.com', data = 'foo:bar')

but this leaves the webpage unaltered, any ideas?

like image 680
scabbers Avatar asked May 16 '26 05:05

scabbers


1 Answers

For people stumbling hare after all these years, try this maybe

import requests
r = request.get("www.url.com", params={"foo": "bar"})
like image 82
NaturalBornCamper Avatar answered May 18 '26 22:05

NaturalBornCamper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!