Fixed a syntax error in the file upload example (#3692)
This commit is contained in:
parent
435e1dac89
commit
def4778d62
@ -191,7 +191,7 @@ You can also explicitly set the filename and content type, by using a tuple
|
||||
of items for the file value:
|
||||
|
||||
```pycon
|
||||
>>> with open('report.xls', 'rb') report_file:
|
||||
>>> with open('report.xls', 'rb') as report_file:
|
||||
... files = {'upload-file': ('report.xls', report_file, 'application/vnd.ms-excel')}
|
||||
... r = httpx.post("https://httpbin.org/post", files=files)
|
||||
>>> print(r.text)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user