I'm trying to authenticate a bot which posts on stocktwits (see API) with Python/pycurl. As I understand it, first I need to request that the application is authorized to use Stocktwits user data via oauth/authorize
, which returns an authorization code. Then I need to confirm permission via oauth/token
, which would send back an access token that can be used to post stocktwits.
The problem I'm running into is that after I make a post request to auth/authorize
, the response returned is
Host: api.stocktwits.com
Authorization: Basic bmljay5vc2hpbm92QGdtYWlsLmNvbTp6YWRuaWsxMg==
User-Agent: PycURL/7.43.0.2 libcurl/7.60.0 OpenSSL/1.1.0h zlib/1.2.11 c-
ares/1.14.0 WinIDN libssh2/1.8.0 nghttp2/1.32.0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
< HTTP/1.1 100 Continue
and the program just stalls waiting. How can I handle the http 100
response?
Code for api call is below
def get_auth_token:
auth_data = ""
c = pycurl.Curl()
c.setopt(c.CAINFO, self.CA_CERTS)
c.setopt(pycurl.POST, 1)
c.setopt(c.URL, uri_to_ouath_authorize_call)
c.setopt(c.FOLLOWLOCATION, True)
c.setopt(c.WRITEDATA, auth_data)
c.setopt(c.USERPWD, 'bot_account_username:password')