How to specify cookies and headers?

$.ajax({ 
credentials: 'include',
type: 'GET', 
url: 'https://opskins.com/ajax/browse_scroll.php?page=1&appId=730&contextId=2', 
 dataType: 'json',
 contentType: 'json',
success: (body) => { console.log(body); } });

Code of this type works perfectly from the console. But if I run the code from the extension that the console gives an error 403. I understand that just because it is not done, because of restrictions of the browser. C# pointed out the headers, cookies, everything works, the answer comes. In an Internet did not find specific information how to do it in js, and that would not be access errors.
June 10th 19 at 15:21
1 answer
June 10th 19 at 15:23
$.ajax({
 url: 'foo/bar',
 headers: { 'x-my-custom-header': 'some value' }
});
and cookies can be omitted ? - ezequiel commented on June 10th 19 at 15:26
cookies - this is one of the headlines
$.ajax({
 url: 'foo/bar',
 headers: { 'x-my-custom-header': 'some value', 'Cookie' : 'zzzzzzz' }
});
- Austen.Thompson53 commented on June 10th 19 at 15:29
lol. So in the cookie is a big list of names using ";" like. As it is there to push ? ) - ezequiel commented on June 10th 19 at 15:32
The string in which pairs of the form key=value are separated by a semicolon.
https://developer.mozilla.org/ru/docs/Web/HTTP/%D0...

What exactly is the problem? - Austen.Thompson53 commented on June 10th 19 at 15:35
indicate and cookies and headers , as said, everything is exactly the 403 error. Although the same values mean in C# everything works - ezequiel commented on June 10th 19 at 15:38
so I have cookies to provide?
$.ajax({
 url: 'foo/bar',
 headers: { 'x-my-custom-header': 'some value', 'Cookie' : 'vvv = bbb; fff = ggg; nnn = mmm' }
});
- ezequiel commented on June 10th 19 at 15:41
it works , I forgot to put a comma to close headers )) - ezequiel commented on June 10th 19 at 15:44
take maybe some editor that highlights syntax, and the simplest mistakes. - Austen.Thompson53 commented on June 10th 19 at 15:47
in 2010 visual Studio can js install - ezequiel commented on June 10th 19 at 15:50
and how come that
I forgot to put a comma
- Austen.Thompson53 commented on June 10th 19 at 15:53
only install in notpade worked - ezequiel commented on June 10th 19 at 15:56

Find more questions by tags JavaScriptjQuery