Closed Tunous closed 2 years ago
Given search API call that uses colon character (:) in its query Twitter is always returning unauthorized response with about:blank type.
:
about:blank
Example call:
try await client.searchRecentTweets(query: "conversation_id:1575266034457579520")
Received response:
{ "detail": "Unauthorized", "status": 401, "title": "Unauthorized", "type": "about:blank" }
From my investigation it looks like the request fails because of : character in query, which Twitter expects to be encoded as %3A. That is confirmed by looking at documentation: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query#adding-a-query
%3A
Manually adding colon encoding in addition to system behavior resolves the issue.
Tested on iOS 16.0 simulator.
Given search API call that uses colon character (
:
) in its query Twitter is always returning unauthorized response withabout:blank
type.Example call:
Received response:
From my investigation it looks like the request fails because of
:
character in query, which Twitter expects to be encoded as%3A
. That is confirmed by looking at documentation: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query#adding-a-queryManually adding colon encoding in addition to system behavior resolves the issue.
Tested on iOS 16.0 simulator.