psn_request.js
function GetHeaders(additional_headers)
	{
		var ret_headers = {};
		// clone default headers into our return object (parsed)
		for(var key in headers)
		{
			ret_headers[key] = ParseStaches(headers[key]);
		}

		// add accept-language header based on our language
		ret_headers['Accept-Language'] = auth_obj.npLanguage + "," + languages.join(',');

		// add access token (if we have one)
		if (auth_obj.access_token)
		{
    		ret_headers['Authorization'] = 'Bearer ' + auth_obj.access_token;
		}

		// add additional headers (if supplied) (parsed)
		if (additional_headers) for(var key in additional_headers)
		{
			ret_headers[key] = ParseStaches(additional_headers[key]);
		}

		return ret_headers;
	}
function GetHeaders(additional_headers)
	{
		var ret_headers = {};
		// clone default headers into our return object (parsed)
		for(var key in headers)
		{
			ret_headers[key] = ParseStaches(headers[key]);
		}

		// add accept-language header based on our language
		ret_headers['Accept-Language'] = auth_obj.npLanguage + "," + languages.join(',');

		// add access token (if we have one)
		if (auth_obj.access_token)
		{
    		ret_headers['Authorization'] = 'Bearer ' + auth_obj.access_token;
		}

		// add additional headers (if supplied) (parsed)
		if (additional_headers) for(var key in additional_headers)
		{
			ret_headers[key] = ParseStaches(additional_headers[key]);
		}

		return ret_headers;
	}
function GetHeaders ( additional_headers ) { var ret_headers = { } ; // clone default headers into our return object (parsed) for ( var key in headers ) { ret_headers [ key ] = ParseStaches ( headers [ key ] ) ; } // add accept-language header based on our language ret_headers [ 'Accept-Language' ] = auth_obj . npLanguage + "," + languages . join ( ',' ) ; // add access token (if we have one) if ( auth_obj . access_token ) { ret_headers [ 'Authorization' ] = 'Bearer ' + auth_obj . access_token ; } // add additional headers (if supplied) (parsed) if ( additional_headers ) for ( var key in additional_headers ) { ret_headers [ key ] = ParseStaches ( additional_headers [ key ] ) ; } return ret_headers ; }
Generate headers for a PSN request
Generate headers for a PSN request