July 2018
Intermediate to advanced
324 pages
8h 14m
English
We enabled the API key's authentication, and so the API key is mandatory with the x-api-key header. If a request hits the API without the x-api-key header, then it would be denied access with the forbidden response. If a user provides the valid API key value in the x-api-key header, then it would be allowed to access the API resource.
API execution without the x-api-key header is as follows:
$ curl https://random-quote.abdulwahid.info/{"message":"Forbidden"}
API execution with the x-api-key header is as follows:
$ curl --header "x-api-key: yEddw9WeMH2UIZXHcaHQb1WvbindovrB55Rf4eAW" https://random-quote.abdulwahid.info/{"quote": "Problems worthy of attack prove their worth by fighting back.", "author": ...Read now
Unlock full access