Does Twitter OAuth support queryString parameters containing spaces in the callBack url?

For source information, I use TweetSharp 1.0 to execute tweets. Callbacks are received regardless of whether they contain the querystring parameter (CallbackConfirmed is true), but they are not redirected after authorization when they contain the querystring parameter. They go on twitter looking beautiful and dandy (for example: http://api.twitter.com/oauth/authorize?oauth_token=MYTOKENREMOVED&oauth_callback=http://www.mywebsite.co.uk?q=Woop%20Woop ), but when twitter needs to redirect to the return url, it just redirects them to twitter.com.

This only happens when I use spaces in the url callback - oauth_callback = http://www.mywebsite.co.uk?q=Woop_Woop , while oauth_callback = http://www.mywebsite.co.uk?q=Woop % 20Woop does not work.

+3
source share
2 answers

Any request parameters you specify must be encoded in url. Spaces should become "+", not% 20 (Server.UrlEncode will do the job in .NET). % 20 does not match + , so oauth_callback = http://www.mywebsite.co.uk?q=Woop%20Woop should be: oauth_callback = http://www.mywebsite.co.uk?q=Woop+Woop

... Server.UrlEncode , " " (. 5.1 http://oauth.net/core/1.0/), # - . , JavaScript , . # : .net UrlEncode -

+4

- . , , , , , , , , querystring. ( , )

0

Source: https://habr.com/ru/post/1756143/


All Articles