psf / requests

A simple, yet elegant, HTTP library.

Home Page:https://requests.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what if someone sets both data and files when making a request?

siddhsql opened this issue · comments

from the docs:

data – (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the Request.

files – (optional) Dictionary of 'name': file-like-objects (or {'name': file-tuple}) for multipart encoding upload. file-tuple can be a 2-tuple ('filename', fileobj), 3-tuple ('filename', fileobj, 'content_type') or a 4-tuple ('filename', fileobj, 'content_type', custom_headers), where 'content_type' is a string defining the content type of the given file and custom_headers a dict-like object containing additional headers to add for the file.

what happens if someone sets both? i ask because AFAIU, files is sent in the request body

As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow