1

If I were trying to google something, how would I send the data I want to search to be searched? I know you can add it to the url, but I do not want to do this.

1
  • which version of python are you using? Commented Jun 29, 2012 at 19:47

1 Answer 1

1

Using the requests library. You would use the .post method in the same way as the .get method. Passing in the data as a dictionary to the data parameter of the function.

The quickstart docs describe it here http://requests.readthedocs.org/en/latest/user/quickstart/#more-complicated-post-requests

If using urllib or urllib2 the data parameter of the urlopen function will POST the data to the page rather than GET it.

see the docs here http://docs.python.org/library/urllib.html#urllib.urlopen

Sign up to request clarification or add additional context in comments.

2 Comments

The OP is asking about how to use the "requests" third-party library.
oh :) I just thought he meant requests in a general sense.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.