Twitter API using getdata
Mostrar comentarios más antiguos
How do I add the bearer token in a header using the getdata() function.
an example from the API
curl 'https://api.twitter.com/2/tweets?ids=1204084171334832128&tweet.fields=public_metrics&expansions=attachments.media_keys&media.fields=public_metrics' --header 'Authorization: Bearer $BEARER_TOKEN'
im not sure how to handle the header part
2 comentarios
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
el 28 de Feb. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre MATLAB Compiler SDK en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!