This is probably a super-easy answer for most folks, but I'm new to back-end. I'm using Express.js to implement my server, and I need to retrieve courses from the edX API. Below is the sample request they have on their docs:
curl -X GET -H "Authorization: JWT {access token}" https://api.edx.org/catalog/v1/catalogs/
and I can't seem to find a starting point on how to translate this to Express.js implementations. I was able to perform similar requests to another API using 'request-promise'), but this is the first that requires a JWT Auth...
Thanks a ton in advance!
Turns out it was super similar to the above, but with a different setup (using the request-promise library):
request.get('https://api.edx.org/catalog/v1/catalogs/', {
"url":APIURL,
"headers":{
"Authorization": "JWT {access token}",
"User-Agent": "client"
}
});
Source: Using an authorization header with Fetch in React Native