psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.19k stars 9.33k forks source link

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

Closed siddhsql closed 7 months ago

siddhsql commented 7 months ago

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

github-actions[bot] commented 7 months ago

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