In order to add additional headers to the allowed headers, we have to configure CORS headers per API level. Once we configure, we can include additional headers in the API Console.
In the example below, we will add a custom header called "setName" to an existing API and invoke it from the Developer Portal.
Now we have completed for configuring CORS headers. Then we need to include additional headers in the API Console.
- Edit a published API again, then navigate down to the API Definition section and click method to expand it.
- Create the header using the Add Parameter button and set "Parameter Type" as Header.
- Once you are done, click Save.
- Log in to the API Store, subscribe to the API and generate an access token for the application you subscribed with.
- If it's an API that you are already subscribed to, you might have to regenerate the access token from the Applications page.
- Click on the API again to open it and then click its API Console tab.
- Expand the method, fill the parameter values and invoke the API.







Comments
Post a Comment