mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[GH-ISSUE #156] Update twitter status,authorization problem #95
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#95
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 @ohcrfpv on GitHub (Dec 13, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/156
OAuthSwift version is
0.4.8Twitter API is
https://api.twitter.com/1.1/statuses/update.json,you can visit
https://dev.twitter.com/rest/reference/post/statuses/updatefor more detail.When my parameters has
in_reply_to_status_id,it return like belowBut only send
statusis ok, it is pretty odd.My project use
https://github.com/Alamofire/Alamofireto request the Twitter REST API.I write a method to fetch header,do not forget replace the oauth_token,oauth_token_secret and Config,for some personal reason,i don't want to expose it:
and set the header
The class is:
the class to request
other class
Reproduce the issue
Not the encode problem,I change Alamofire
ParameterEncoding.swiftline 209,add?and/,beacuse twitter update status is encode in url,not json.@ohcrfpv commented on GitHub (Dec 13, 2015):
@phimage It seems the Blank string in parameters is not encoded.
@ohcrfpv commented on GitHub (Dec 13, 2015):
It is real the problem that the blank string in parameters is not encoded. I already solved it :)
@phimage commented on GitHub (Dec 13, 2015):
ok good to know
(I started a project in my private server OAuthSwift-Alamofire but not ready for the moment)
Just for info no need to close the issue here, if I merge the PR you make this will close the issue automatically
@phimage commented on GitHub (Dec 23, 2015):
I try to find a better solution without success by using
NSCharacterSet.URLQueryAllowedCharacterSet()or this union ofNSCharacterSetURLXXXAllowedCharacterSetthe
testSignaturefailedurlEncodedStringWithEncodingis used to encode url and parameters, but also to compute signature Maybe there is two things different here to separate!!Signature is described here https://tools.ietf.org/html/rfc5849#section-3.6 and there is some info about the difference, and the space encoding
With or without space the
testSignaturesuccess, but maybe because no space is into the testAnyway I think I will merge your PR
and study #115 where there is some alternative code which use a
NSCharacterSetURLXXXAllowedCharacterSet@ohcrfpv commented on GitHub (Dec 24, 2015):
@phimage 👍