Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # In safari:
- # Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
- # Test in python:
- import requests
- url = 'https://my.site.ru/api/file/'
- with open('test_2m', 'rb') as f:
- data = {'origin': f}
- r = requests.post(url, files=data)
- # requests.exceptions.ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
- # Test in httpie:
- http -f post http://my.site.ru/api/file/ origin@test_2m
- # http: error: ConnectionError: ('Connection aborted.', BrokenPipeError(32, 'Broken pipe'))
- # Test against http://httpbin.org/post
- from pprint import pprint
- import requests
- url = 'http://httpbin.org/post'
- with open('test_2m', 'rb') as f:
- data = {'origin': f}
- r = requests.post(url, files=data)
- pprint(r.json()['headers'])
- {'Accept': '*/*',
- 'Accept-Encoding': 'gzip, deflate',
- 'Connection': 'close',
- 'Content-Length': '1100145',
- 'Content-Type': 'multipart/form-data; '
- 'boundary=216f8fc98dee4a6cbe4e295f2048bbbd',
- 'Host': 'httpbin.org',
- 'User-Agent': 'python-requests/2.14.2'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement