Javascript samples updated

This commit is contained in:
Rastislav Kostrab
2016-03-01 14:39:16 +01:00
parent 42a3f184ff
commit 734681ad59
4 changed files with 59 additions and 16 deletions

View File

@@ -22,18 +22,23 @@
this.basePath = 'http://petstore.swagger.io/v2'.replace(/\/+$/, '');
this.authentications = {
'petstore_auth': {type: 'oauth2'},
'test_api_client_id': {type: 'apiKey', in: 'header', name: 'x-test_api_client_id'},
'test_api_client_secret': {type: 'apiKey', in: 'header', name: 'x-test_api_client_secret'},
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'},
'api_key': {type: 'apiKey', in: 'header', name: 'api_key'},
'test_api_client_secret': {type: 'apiKey', in: 'header', name: 'x-test_api_client_secret'},
'test_api_client_id': {type: 'apiKey', in: 'header', name: 'x-test_api_client_id'},
'test_api_key_query': {type: 'apiKey', in: 'query', name: 'test_api_key_query'},
'test_api_key_header': {type: 'apiKey', in: 'header', name: 'test_api_key_header'}
'petstore_auth': {type: 'oauth2'}
};
/**
* The default HTTP headers to be included for all API calls.
*/
this.defaultHeaders = {};
/**
* The default HTTP timeout for all API calls.
*/
this.timeout = 60000;
};
ApiClient.prototype.paramToString = function paramToString(param) {
@@ -234,6 +239,9 @@
// set header parameters
request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
//set request timeout
request.timeout(this.timeout);
var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) {
request.type(contentType);