Clarify auth header documentation

This commit is contained in:
Avi Weinstock-Herman
2016-07-12 15:17:16 -06:00
parent e6ac8bf2ed
commit 6d7ede75e3

View File

@@ -124,12 +124,12 @@ Header params are supported through a pluggable mechanism in [swagger-js](https:
$('#input_apiKey').change(function() {
var key = $('#input_apiKey')[0].value;
if(key && key.trim() != "") {
swaggerUi.api.clientAuthorizations.add("key", new SwaggerClient.ApiKeyAuthorization("api_key", key, "header"));
swaggerUi.api.clientAuthorizations.add("auth_name", new SwaggerClient.ApiKeyAuthorization("api_key", key, "header"));
}
})
```
This will add header `api_key` with value `key` on every call to the server. You can substitute `query` to send the values as a query param.
This will add the header `api_key` with value `key` on calls that have the `auth_name` security scheme as part of their swaggerDefinitions. You can substitute `query` to send the values as a query param.
### Custom Header Parameters - (For Basic auth etc)
If you have some header parameters which you need to send with every request, use the headers as below: