remove " \r\n " from authorization headers

Viewed 14

I'm facing an issue when making a post request,

I'm passing the jwt in the headers but somehow when passing the token it adds an \r\n at the end so I get an unauthorized 401. If I try the same request in Postman it works.

My headers look like

_header: 'POST /my/post/url\r\n' +
        'Accept: accept\r\n' +
        'Content-Type: content\r\n' +
        'Authorization: jsonWebToken\r\n' +
        'User-Agent: axios\r\n' +
        'Host: localhost\r\n' +
        '\r\n',
0 Answers
Related