Http get request with header

baseUrl = ‘’;

headers :{ ‘user-key’ : ‘0c3b1b0774975e0280290d78aae415ec’ }

i’m trying

this.http.get(baseUrl, headers).map(res => res.json());

but not working how do I suppose to write get data?

Thanks in advance!!

“Not working” conveys very little information. What is going over the wire in each direction?

How to pass header in HTTP.GET scenario
while url: ‘’;
and header is { ‘user-key’ : ‘0c3b1b0774975e0280290d78aae415ec’ }

how should i create get request?

You didn’t answer my question:

not getting your question?

What does your code request from the server and what does the server respond to it right now?

let endPoint = '';
let headersObj = new Headers({'user-key':'0c3b1b0774975e0280290d78aae415ec'});

this.http.get(endPoint, {headers:headersObj}).map(res => {
      if (res.status < 200 || res.status > 300) {
        throw new Error("Error in your code with status" + res.status);
      return res.json()

I hope this will help you getting your issue solved.