HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it
I keep getting the above 403 error when performing an AJAX call to an API.
The error occurs in Microsoft Edge, but does not occur in IE, Chrome, Firefox or Safari.
The page does not use bootstrap, as i have read that it can be caused by the page not been able to locate the .LESS files required. I have even tried to include bootstrap to see if that resolved the issue - It did not.
I don't seem to be able to find anything by googling this, other than some twitter Oauth stuff and the bootstrap answer as above - Both of which aren't relevant to my application.
As i stated before, the AJAX call works fine in any browser, EXCEPT Edge. The code is the exact same across the various browsers and the response/request headers match one another - So isn't a case that the POST request is sending incorrect data (in case of different browser defaults or something).
This is what i'm trying to achieve:
index.html contains 4 iFrames housing adverts. My Javascript code then picks up the iFrame tag and overlays a thumbs up/down icon where the user can provide feedback for said adverts. The AJAX call is passed the Advert URL (iFrame src) and the users id (consumer_id). It then returns an impression ID after it has written to the Database to record the thumbs up/down action.
Example Code:
index.html:
<body>
<iframe src="https://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" bordercolor="#000000"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="client.js"></script>
</body>
AJAX Call:
// This isn't usually a var, but added for clarity. Usually uses a selector
// to grab the entire iframe DOM element, and then store in array.
var iframe = "http://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?";
$.ajax({
method: 'POST',
url: 'http://my.api/url/',
async: false,
datatype: 'json',
data: {
ad_url: iframe, // fetch ad_url from iframe src
wittel_consumer: "57fcea30f910092a06806344"
},
success: function(data, respText, xhr) {
console.log('Data',data);
console.log('XHR',xhr);
},
error: function(error) {
console.log('URL',this.url);
console.log('Error',error);
}
});
In this code, the AJAX is actioned, but returns under the 'error' method. I can see the URL is correct, and inside the error
callback, I just get an object containing the likes of readyState: 4, status: 403, statusText: "Forbidden"
. As stated, the API does work, as it is successfully completed in any other browser, so must be something to do with the way Edge handles the request. Or could it be a server configuration thing? I honestly have no idea.
Full Error:
HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it.
(XHR)POST - http://my.api/url/
javascript ajax http-status-code-403
add a comment |
I keep getting the above 403 error when performing an AJAX call to an API.
The error occurs in Microsoft Edge, but does not occur in IE, Chrome, Firefox or Safari.
The page does not use bootstrap, as i have read that it can be caused by the page not been able to locate the .LESS files required. I have even tried to include bootstrap to see if that resolved the issue - It did not.
I don't seem to be able to find anything by googling this, other than some twitter Oauth stuff and the bootstrap answer as above - Both of which aren't relevant to my application.
As i stated before, the AJAX call works fine in any browser, EXCEPT Edge. The code is the exact same across the various browsers and the response/request headers match one another - So isn't a case that the POST request is sending incorrect data (in case of different browser defaults or something).
This is what i'm trying to achieve:
index.html contains 4 iFrames housing adverts. My Javascript code then picks up the iFrame tag and overlays a thumbs up/down icon where the user can provide feedback for said adverts. The AJAX call is passed the Advert URL (iFrame src) and the users id (consumer_id). It then returns an impression ID after it has written to the Database to record the thumbs up/down action.
Example Code:
index.html:
<body>
<iframe src="https://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" bordercolor="#000000"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="client.js"></script>
</body>
AJAX Call:
// This isn't usually a var, but added for clarity. Usually uses a selector
// to grab the entire iframe DOM element, and then store in array.
var iframe = "http://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?";
$.ajax({
method: 'POST',
url: 'http://my.api/url/',
async: false,
datatype: 'json',
data: {
ad_url: iframe, // fetch ad_url from iframe src
wittel_consumer: "57fcea30f910092a06806344"
},
success: function(data, respText, xhr) {
console.log('Data',data);
console.log('XHR',xhr);
},
error: function(error) {
console.log('URL',this.url);
console.log('Error',error);
}
});
In this code, the AJAX is actioned, but returns under the 'error' method. I can see the URL is correct, and inside the error
callback, I just get an object containing the likes of readyState: 4, status: 403, statusText: "Forbidden"
. As stated, the API does work, as it is successfully completed in any other browser, so must be something to do with the way Edge handles the request. Or could it be a server configuration thing? I honestly have no idea.
Full Error:
HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it.
(XHR)POST - http://my.api/url/
javascript ajax http-status-code-403
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54
add a comment |
I keep getting the above 403 error when performing an AJAX call to an API.
The error occurs in Microsoft Edge, but does not occur in IE, Chrome, Firefox or Safari.
The page does not use bootstrap, as i have read that it can be caused by the page not been able to locate the .LESS files required. I have even tried to include bootstrap to see if that resolved the issue - It did not.
I don't seem to be able to find anything by googling this, other than some twitter Oauth stuff and the bootstrap answer as above - Both of which aren't relevant to my application.
As i stated before, the AJAX call works fine in any browser, EXCEPT Edge. The code is the exact same across the various browsers and the response/request headers match one another - So isn't a case that the POST request is sending incorrect data (in case of different browser defaults or something).
This is what i'm trying to achieve:
index.html contains 4 iFrames housing adverts. My Javascript code then picks up the iFrame tag and overlays a thumbs up/down icon where the user can provide feedback for said adverts. The AJAX call is passed the Advert URL (iFrame src) and the users id (consumer_id). It then returns an impression ID after it has written to the Database to record the thumbs up/down action.
Example Code:
index.html:
<body>
<iframe src="https://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" bordercolor="#000000"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="client.js"></script>
</body>
AJAX Call:
// This isn't usually a var, but added for clarity. Usually uses a selector
// to grab the entire iframe DOM element, and then store in array.
var iframe = "http://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?";
$.ajax({
method: 'POST',
url: 'http://my.api/url/',
async: false,
datatype: 'json',
data: {
ad_url: iframe, // fetch ad_url from iframe src
wittel_consumer: "57fcea30f910092a06806344"
},
success: function(data, respText, xhr) {
console.log('Data',data);
console.log('XHR',xhr);
},
error: function(error) {
console.log('URL',this.url);
console.log('Error',error);
}
});
In this code, the AJAX is actioned, but returns under the 'error' method. I can see the URL is correct, and inside the error
callback, I just get an object containing the likes of readyState: 4, status: 403, statusText: "Forbidden"
. As stated, the API does work, as it is successfully completed in any other browser, so must be something to do with the way Edge handles the request. Or could it be a server configuration thing? I honestly have no idea.
Full Error:
HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it.
(XHR)POST - http://my.api/url/
javascript ajax http-status-code-403
I keep getting the above 403 error when performing an AJAX call to an API.
The error occurs in Microsoft Edge, but does not occur in IE, Chrome, Firefox or Safari.
The page does not use bootstrap, as i have read that it can be caused by the page not been able to locate the .LESS files required. I have even tried to include bootstrap to see if that resolved the issue - It did not.
I don't seem to be able to find anything by googling this, other than some twitter Oauth stuff and the bootstrap answer as above - Both of which aren't relevant to my application.
As i stated before, the AJAX call works fine in any browser, EXCEPT Edge. The code is the exact same across the various browsers and the response/request headers match one another - So isn't a case that the POST request is sending incorrect data (in case of different browser defaults or something).
This is what i'm trying to achieve:
index.html contains 4 iFrames housing adverts. My Javascript code then picks up the iFrame tag and overlays a thumbs up/down icon where the user can provide feedback for said adverts. The AJAX call is passed the Advert URL (iFrame src) and the users id (consumer_id). It then returns an impression ID after it has written to the Database to record the thumbs up/down action.
Example Code:
index.html:
<body>
<iframe src="https://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?" width="728" height="90" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" bordercolor="#000000"></iframe>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="client.js"></script>
</body>
AJAX Call:
// This isn't usually a var, but added for clarity. Usually uses a selector
// to grab the entire iframe DOM element, and then store in array.
var iframe = "http://ad.doubleclick.net/ddm/adi/N4406.154378.CRITEO/B9862737.133255611;sz=728x90;click=http://cat.fr.eu.criteo.com/delivery/ck.php?cppv=1&cpp=ZNbxVXxoRmlURGJwS3JrRUZxTXVnNG83QmlTRUhSNDgzZEFXeEt6Q2VkcXpuTlFXTzBPUytNL0t3QW1NR2hiWXMyU1Jjb0NsTDZZQk8ybzRnajZnZlNodTJKNjhiSW8yaFlPTVBDRUlZQjJ5QVNUQjQrNHd5UEJicEI5OS95NUUxMWVDbGRZamZ4RjZYS1FHam5LQ1dpcENzanhtcEhlckpmOEVuSUhRTllIQnBPazlnMnQ3eWVJcjhOSzRYOXYwOXlqYVFrTnI0eDZJSTBjR1lGM2VUVVloQjd3RlJUcndIQUl3NUpRalY0YXV3Q29SRktKSkFJSktueU0vMVdydko4UzZGSldkbUR1RUR4MTU2a0loamFYZlpiZz09fA%3D%3D&maxdest=;dcopt=anid;ord=f4840e2d31;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?";
$.ajax({
method: 'POST',
url: 'http://my.api/url/',
async: false,
datatype: 'json',
data: {
ad_url: iframe, // fetch ad_url from iframe src
wittel_consumer: "57fcea30f910092a06806344"
},
success: function(data, respText, xhr) {
console.log('Data',data);
console.log('XHR',xhr);
},
error: function(error) {
console.log('URL',this.url);
console.log('Error',error);
}
});
In this code, the AJAX is actioned, but returns under the 'error' method. I can see the URL is correct, and inside the error
callback, I just get an object containing the likes of readyState: 4, status: 403, statusText: "Forbidden"
. As stated, the API does work, as it is successfully completed in any other browser, so must be something to do with the way Edge handles the request. Or could it be a server configuration thing? I honestly have no idea.
Full Error:
HTTP403: FORBIDDEN - The server understood the request, but is refusing to fulfill it.
(XHR)POST - http://my.api/url/
javascript ajax http-status-code-403
javascript ajax http-status-code-403
asked Oct 14 '16 at 9:05


Scott ThorntonScott Thornton
1261113
1261113
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54
add a comment |
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?
headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?
headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54
add a comment |
4 Answers
4
active
oldest
votes
For anyone else having this issue:
I put my code on a server and ran to it from there to test if it was the localhost connection - Which it was.
The API i am using must be configured to not allow localhost connections, which i've never experienced before.
Great way to waste 2 days and lose your sanity though!
Thanks for the above suggestions anyway. Appreciate it.
add a comment |
I just had the same problem.
It turned out that it has something to do with some of the records in the database. The operations function smoothly in most of the records but, on some, I get the 403 and, if I insist, I get 500.
My own experience says it has nothing to do with localhost. It works fine. It has to do with some of your records .... look for duplicity on non key fields but referred to in your queries.
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at<body</body>
, you might want to fix that. :)
– jbehrens94
Oct 19 '17 at 14:47
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
add a comment |
Try adding these settings to your request:
"headers": {
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"processData": false,
add a comment |
Please include credentials in the options.
var url = 'https://dummy_url/_api/lists'
var options = {
headers: {"Accept": "application/json; odata=verbose"},
credentials: 'include'
}
fetch(url, options).then(
res => res.json().then(json => console.dir(json))
)
This works for me.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40039190%2fhttp403-forbidden-the-server-understood-the-request-but-is-refusing-to-fulfi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
For anyone else having this issue:
I put my code on a server and ran to it from there to test if it was the localhost connection - Which it was.
The API i am using must be configured to not allow localhost connections, which i've never experienced before.
Great way to waste 2 days and lose your sanity though!
Thanks for the above suggestions anyway. Appreciate it.
add a comment |
For anyone else having this issue:
I put my code on a server and ran to it from there to test if it was the localhost connection - Which it was.
The API i am using must be configured to not allow localhost connections, which i've never experienced before.
Great way to waste 2 days and lose your sanity though!
Thanks for the above suggestions anyway. Appreciate it.
add a comment |
For anyone else having this issue:
I put my code on a server and ran to it from there to test if it was the localhost connection - Which it was.
The API i am using must be configured to not allow localhost connections, which i've never experienced before.
Great way to waste 2 days and lose your sanity though!
Thanks for the above suggestions anyway. Appreciate it.
For anyone else having this issue:
I put my code on a server and ran to it from there to test if it was the localhost connection - Which it was.
The API i am using must be configured to not allow localhost connections, which i've never experienced before.
Great way to waste 2 days and lose your sanity though!
Thanks for the above suggestions anyway. Appreciate it.
answered Oct 14 '16 at 9:56


Scott ThorntonScott Thornton
1261113
1261113
add a comment |
add a comment |
I just had the same problem.
It turned out that it has something to do with some of the records in the database. The operations function smoothly in most of the records but, on some, I get the 403 and, if I insist, I get 500.
My own experience says it has nothing to do with localhost. It works fine. It has to do with some of your records .... look for duplicity on non key fields but referred to in your queries.
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at<body</body>
, you might want to fix that. :)
– jbehrens94
Oct 19 '17 at 14:47
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
add a comment |
I just had the same problem.
It turned out that it has something to do with some of the records in the database. The operations function smoothly in most of the records but, on some, I get the 403 and, if I insist, I get 500.
My own experience says it has nothing to do with localhost. It works fine. It has to do with some of your records .... look for duplicity on non key fields but referred to in your queries.
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at<body</body>
, you might want to fix that. :)
– jbehrens94
Oct 19 '17 at 14:47
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
add a comment |
I just had the same problem.
It turned out that it has something to do with some of the records in the database. The operations function smoothly in most of the records but, on some, I get the 403 and, if I insist, I get 500.
My own experience says it has nothing to do with localhost. It works fine. It has to do with some of your records .... look for duplicity on non key fields but referred to in your queries.
I just had the same problem.
It turned out that it has something to do with some of the records in the database. The operations function smoothly in most of the records but, on some, I get the 403 and, if I insist, I get 500.
My own experience says it has nothing to do with localhost. It works fine. It has to do with some of your records .... look for duplicity on non key fields but referred to in your queries.
edited Oct 19 '17 at 17:36
answered Oct 19 '17 at 14:29
Jay Ell IIIJay Ell III
11
11
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at<body</body>
, you might want to fix that. :)
– jbehrens94
Oct 19 '17 at 14:47
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
add a comment |
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at<body</body>
, you might want to fix that. :)
– jbehrens94
Oct 19 '17 at 14:47
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at
<body</body>
, you might want to fix that. :)– jbehrens94
Oct 19 '17 at 14:47
Great answer! Could you maybe include your code as a code block? To do that, edit your answer, select your code and press ctrl/cmd+k or indent with 4 spaces. Also, I notice a small bug in your HTML code at
<body</body>
, you might want to fix that. :)– jbehrens94
Oct 19 '17 at 14:47
1
1
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
Ha ha ha ..... awesome .... I do have fast fingers .... crippling most of what I type ... the problem was just here; not in the origin
– Jay Ell III
Oct 19 '17 at 17:29
add a comment |
Try adding these settings to your request:
"headers": {
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"processData": false,
add a comment |
Try adding these settings to your request:
"headers": {
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"processData": false,
add a comment |
Try adding these settings to your request:
"headers": {
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"processData": false,
Try adding these settings to your request:
"headers": {
"Content-Type": "application/json",
"cache-control": "no-cache",
},
"processData": false,
answered Nov 20 '18 at 9:52
Guildenstern70Guildenstern70
1,1301112
1,1301112
add a comment |
add a comment |
Please include credentials in the options.
var url = 'https://dummy_url/_api/lists'
var options = {
headers: {"Accept": "application/json; odata=verbose"},
credentials: 'include'
}
fetch(url, options).then(
res => res.json().then(json => console.dir(json))
)
This works for me.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Please include credentials in the options.
var url = 'https://dummy_url/_api/lists'
var options = {
headers: {"Accept": "application/json; odata=verbose"},
credentials: 'include'
}
fetch(url, options).then(
res => res.json().then(json => console.dir(json))
)
This works for me.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Please include credentials in the options.
var url = 'https://dummy_url/_api/lists'
var options = {
headers: {"Accept": "application/json; odata=verbose"},
credentials: 'include'
}
fetch(url, options).then(
res => res.json().then(json => console.dir(json))
)
This works for me.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Please include credentials in the options.
var url = 'https://dummy_url/_api/lists'
var options = {
headers: {"Accept": "application/json; odata=verbose"},
credentials: 'include'
}
fetch(url, options).then(
res => res.json().then(json => console.dir(json))
)
This works for me.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Jan 17 at 16:56


Roy SelimRoy Selim
1
1
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Roy Selim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40039190%2fhttp403-forbidden-the-server-understood-the-request-but-is-refusing-to-fulfi%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Pretty ropey at debugging things like these... But perhaps try adding headers to your ajax call?
headers: { 'Content-Type': 'application/json; charset=utf-8' }
– Daniel Shillcock
Oct 14 '16 at 9:16
Yes check headers. If post and header are identical, then the server would have no reason to answer once with forbidden and other time with proper result. Your request can't be exactly same, if it is indeed working in other browser - and not just silently failing.
– user5542121
Oct 14 '16 at 9:17
Can you post the full ajax request, including the header? Else you can also try and compare what are the header being sent to server by other browsers and by Edge.
– Deepak jha
Oct 14 '16 at 9:23
Thanks for the responses guys, figured it out. It was because i was performing the call from localhost. Which has never posed a problem for me in the past, but i'm guessing it has something to do with the API config stopping localhost connections.
– Scott Thornton
Oct 14 '16 at 9:54