javascript - Angular Headers Web API -


enter image description here

i trying add x-apikeys headers every api call have examples in curl. have tried:

 var accesskey = "gdgfdgdfgdgdgfdgdfgfdgfdgdgh";  var secretkey = "ggdgfdgdggtet565645654654654";  $http.get("/information",{   headers:{ {"x-apikeys": accesskey, secretkey}}     )  

i have tried make interceptor config:

 config.headers['x-apikeys'] = {accesskey, secretkey} 

the structure x-apikeys think causing me issues. have provided picture of http headers looking for.

full request header:

  accept:*/*   accept-encoding:gzip, deflate, sdch   accept-language:en-us,en;q=0.8   access-control-request-headers:accept, x-apikeys   access-control-request-method:get   connection:keep-alive   host:   origin:http://localhost:60531   referer:http://localhost:60531/   user-agent:mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/48.0.2564.103 safari/537.36 

here request header trying tomislav example: enter image description here

try this:

$http.get("/information",{     headers: { 'x-apikeys': 'accesskey=' + accesskey+'; secretkey='+secretkey+';' }}) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -