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

Add httpclient module, using custom httphandler to do POST request #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aware-why
Copy link

It's better for urllib2_file not to change the global variable urllib2._opener but to use temporary opener object generated by urllib2.build_opener(), otherwise, maybe it will influence other modules who are also using urllib2
in the same process.

Custom http handler to handle with the multipart/form-data POST request
"""

def http_request(self, request):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just return the request object directly, to shield the builtin http_request method in urllib2.AbstractHTTPHandler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant