chandra sekhar reddy
chandra sekhar reddy

Reputation: 21

How to send huge files over HTTPPost method in Python, upload large files

I am tring to post huge .ova file through HTTPPost Method in Python

**ResponseHeaders**
Pragma  no-cache
Date    Thu, 18 Jul 2013 11:17:13 GMT
Content-Encoding    gzip
Vary    Accept-Encoding
Server  Apache-Coyote/1.1
Transfer-Encoding   chunked
Content-Language    en-US
Content-Type    application/json;charset=UTF-8
Cache-Control   no-cache, no-store, max-age=0
Expires Thu, 01 Jan 1970 00:00:00 GMT
**RequestHeaders**
Content-Type    application/json
Accept  application/json
xyzAPIVersion   1.0
X-Requested-With    XMLHttpRequest 

How to send such a huge file(500 MB) through HTTPPost method through REST API.

Upvotes: 2

Views: 3189

Answers (1)

jfs
jfs

Reputation: 414205

You could use requests library:

import requests # $ pip install requests

with open("file.ova", "rb") as file:
    requests.post(url, data=file)

Upvotes: 5

Related Questions