user3768495 user3768495 - 13 days ago 4
reST (reStructuredText) Question

how to implement the aws glacier example request in Python?

I am trying to figure out how to do multipart-uploads to AWS Glacier and found some Example Request on this documentation page. How do I implement this example in Python? I think I should use the 'requests' module but don't know exactly how to make it work.

Here is what I have done:

import requests
r = requests.post('/042415267352/vaults/history/multipart-uploads')


And this is the error I have:

MissingSchema: Invalid URL '/042415267352/vaults/history/multipart-uploads': No schema supplied.
Perhaps you meant http:///042415267352/vaults/history/multipart-uploads?


I am having this trouble because I don't really understand these stuff, HTTP request, RESTFul API etc.If someone can suggest some resources for me to learn these, in addition to helping out with this specific question, that will be great! Because I don't want to come here ask question again if I come across similar situation in the future. But for now, I even don't know where to start the learning process.

Your help are highly appreciated!

Answer

You do not need to implement low level HTTP requests yourself, this is what boto module is for in Python. You can do all this via module which abstracts all low level requests for you.

For documentation and examples, see Boto3 Glacier docs which contains lots of examples.

Comments