mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #116] upload seem to not work properly #71
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @olivier38070 on GitHub (Sep 29, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/116
I tried to do upload of image, to smugmug.
I created the api key. I defined the permission properly.
in the demo app, I can authenticate, get information of user, album etc... (with some mint code modification in the demo)
I cannot do any upload
for both, I use the same framework : Oauth1Swift
for upload, I tried postImage() method, and tried to build a modified version of that code.
for upload, I use the information visible here : http://api.smugmug.com/services/api/?method=upload
without the signature calculation fix proposed in another thread, I obtain a "invalid signature" error.
with the signature calculation fix ( compared to the website :
http://oauth.googlecode.com/svn/code/javascript/example/signature.html)
I obtain another error when uploading : System Error 5.
which is something like invalid album
I tried several possibilities :
smugmug API 1.3, API 2.0
Upload using POST, mutlipart, like the code of the sample app does.
Upload using HTTP PUT (I modified the code, to set the body with the image and content-type to image/jpeg)
Upload using HTTP POST (same as above)
I always get the same error. System Error 5.
I think (but I cannot be sure) that there is something not compatible with the framework, and smugmug upload.
could anyone do a test on google account (on my side, it does not work also) or smugmug ?
@phimage commented on GitHub (Sep 29, 2015):
your error is something like that
http://dgrin.com/showthread.php?t=233736
try to see upload log in smugmug account (maybe Tools -> Account Settings -> Stats -> Uploads -> Details) for more information
sorry I have no time to code a test, maybe just test with a provided project
@olivier38070 commented on GitHub (Sep 30, 2015):
I wil check. thanks
anyway, I found that in the httprequest code, when there is a body and a content-type, the non oauth parameters were not added.
after fixing that, it works.
I will d a fork soon, and place my code in it, in order to let you see what I did. may be I did it wrong
thanks
letonNSURLinstead of force unwrapping #503