Azzera filtri
Azzera filtri

Twitter API using getdata

4 visualizzazioni (ultimi 30 giorni)
Xymbu il 28 Feb 2022
Risposto: Xymbu il 1 Mar 2022
How do I add the bearer token in a header using the getdata() function.
an example from the API
curl '' --header 'Authorization: Bearer $BEARER_TOKEN'
im not sure how to handle the header part
  2 Commenti
Ive J
Ive J il 28 Feb 2022
Modificato: Ive J il 28 Feb 2022
What about this?
headers = {'Authorization', ['Bearer ', yourToken]};
options = weboptions('HeaderFields', headers);
res = webread(url, options);
% if that fails, what about this?
res = webwrite(url, headers);
Xymbu il 28 Feb 2022
The first one worked thank you!

Accedi per commentare.

Risposta accettata

Xymbu il 1 Mar 2022
The suggestion in the comments from Ive J works. I ended up, however, calling the python library requests in order to automate the creation of the Oauth1 authentication. This made it very easy to format.

Più risposte (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by