Forum Discussion
I am trying this and found several problems.
When using on the header, the "Content-Type" spec, I always get an error 500 with an "Unknown error" message. I tried removing it and it looks to work better.
Now I am getting a clear "Authentication failed" error message. I think the problem I have now is creating the correct authentication string. As this string is build with, among others, the request details, I don't know how to correctly append this "files" variable (a dictionary object) to the request variable using this piece of code:
#Concatenate Request details
requestVars = httpVerb + epoch + data + resourcePath
#Construct signature
signature = base64.b64encode(hmac.new(AccessKey,msg=requestVars,digestmod=hashlib.sha256).hexdigest())
#Construct headers
auth = 'LMv1 ' + AccessId + ':' + signature + ':' + epoch
headers = {'Authorization':auth}
In this case, "data" is not a string, but a dictionary containing a file object.
How authorization string should be built for this particular case?
I will have a look at the SDK anytime, as suggested.
Related Content
- 2 years ago
- 2 years agoAnonymous
- 2 years agoAnonymous