• Register
1 vote
53 views

Problem :

I keep on facing the below 403 error while performing the AJAX call to the API.

“403 forbidden: the server understood the request, but is refusing to fulfill it.”

Above error occurs usually in Microsoft Edge, but does not come up in IE, Chrome, Firefox or the Safari.

My page does not use the bootstrap, as I know that it can be caused by a page not been able to locate a .LESS files required. Also I have even tried to include the bootstrap to see if that resolved my issue – but it did not.

I am unable to find anything related by doing research on this. My code is exactly the same across all the various browsers and also the response/request headers match to one another - So is it the case that the POST request is sending the incorrect?

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I had the same issue and tried all the solutions which I knew, and neither of them worked actually after long research I found the solution for the error as below:

Please include the credentials in the options as shown in below code snippet.

 

var dummyurl = 'https://dummy_url/_api/lists'
var myoptions = {
    headers: {"Accept": "application/json; odata=verbose"},
    credentials: 'include'
}

fetch(dummyurl, myoptions).then( 
    res => res.json().then(json => console.dir(json)) 
)

 

This works flawlessly for me.

9 7 4
38,600 points

Related questions

0 votes
1 answer 259 views
259 views
Problem : I have spent over the 10 hours in finding the exception or the special character to find in the code but I am unable to find it. I have already checked every similar messages in here. I am facing below error: Syntaxerror: json.parse: unexpected character at line 1 ... my form after that I am sending all the inputs to the main.js to validate it. So, I am just looking for the third-eye.
asked Dec 23, 2019 alecxe 7.5k points
0 votes
1 answer 9 views
9 views
Is there any tutorial that will show how to display database record without without pressing the submit button? For example, <select name="cars"> <option value="">Select a car:</option> <option value="1">Volvo</option> <option value="2">BMW</option> ... > </select> In this example, the user will select anything from the list and should automatically display the information based on the selection.
asked Oct 11 azriel 340 points
0 votes
1 answer 10 views
10 views
We had a online based survey company. We survey the market on the basis of user&rsquo;s opinion. we need to store the user&rsquo;s data and utilize the text data input. How can we do this using javascript ?
asked Sep 15 Daniel Anderson 4k points
0 votes
1 answer 5 views
0 votes
1 answer 7 views
7 views
Problem: I am very new to programming world. I have below HTML code and I want to submit it and save the form data with the help of javascript. <!DOCTYPE html> <html> <head>   <meta charset="utf-8">   <meta name="viewport" content="width=device-width"> ... If I click on the submit button then the above forms data should be saved somewhere for the each and every user who fills and submits the data.
asked Jul 30 Raphael Pacheco 4.9k points