HTTP setHeader Twitter OAuth

fabioferreiracs

Member
Licensed User
Longtime User
I need to make a GET request to get HomeTimeline from Twitter via the address:

https://api.twitter.com/1.1/statuses/home_timeline.json .

Already I have generated keys and access authorization header needed to make the request.
But I do not know how to do this using Http request !
I try this:

B4X:
Dim request As HttpRequest
MainUrl = "https://api.twitter.com/1/statuses/update.json"
request.InitializeGet(MainUrl)
request.SetHeader("Authorization" , Header)

MainRequestId = 1
   
HttpClient1.Execute(request, MainRequestId)

Header contains the Authorization header. But the result is unauthorized code 401.

this header is entirely correct. I think the problem is the way I'm doing this request. Could someone give me a hand?
 

fabioferreiracs

Member
Licensed User
Longtime User
I'm confused on how to generate this request. I tried the HttpClient.ExecuteCredentials , but also not worked. In the case of HttpClient.ExecuteCredentials the username and password need to be encoded?
Would you like an example with some more details. My header is identical to that reported by Twitter. It's not wrong !
The response is always Unauthorized. My code is correct with respect to add the Header?

And in making the request is correct?

Where could it be my fault?
 
Upvote 0
Top