How to call API (Oauth 1.0)?

前端 未结 3 1257
[愿得一人]
[愿得一人] 2020-12-03 16:23

I am trying to call this API (Oauth1.0 standard):

https://appcenter.intuit.com/api/v1/Connection/Reconnect

And what I am doing is : (It am working on java)

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 16:47

    Here is a builder I created to build the OAuth v1 Authorization header. You may find it useful.

    https://gist.github.com/robotdan/33f5834399b6b30fea2ae59e87823e1d

    Example usage calling Twitter:

    String authorizationHeader = new OAuth1AuthorizationHeaderBuilder()
             .withMethod("POST")
             .withURL("https://api.twitter.com/oauth/access_token")
             .withConsumerSecret("twitterConsumerSecret")
             .withTokenSecret("your_oauth_token_secret")
             .withParameter("oauth_consumer_key", "your_consumer_key")
             .withParameter("oauth_token", "your_oauth_token")
             .build()
    

提交回复
热议问题