400 Error with Javascript Rdio API - javascript

Any thoughts on why I'm getting a "Failed to load resource: the server responded with a status of 400 (Bad Request)" in the Javascript on my client? (client-id obscured, I have one for an Oauth2.0 app via registration Rdio site)
index.html:
<script src="https://www.rdio.com/api/api.js?client_id=12345678"></script>
response:
https://www.rdio.com/oauth2/authorize/auto?response_type=token&client_id=12345678&showSignup=true&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fhelper.html%3Fclient_id%3D12345678
Failed to load resource: the server responded with a status of 400 (Bad Request)
John

The response text from the https://www.rdio.com/oauth2/authorize/auto request should reveal the error. For example, making a request from the shell:
$ curl "https://www.rdio.com/oauth2/authorize/auto?response_type=token&client_id=12345678&showSignup=true&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fhelper.html%3Fclient_id%3D1234567"
For a valid client ID, a possible response might be:
Invalid redirect_uri
If this is the error you're receiving, which seems likely, to resolve it, you need to add your redirect_uri's domain to the Redirect URIs in your Rdio application's settings.

Related

Hide http status code warning at chrome developer console

So, I have a rest api developed in Express. For authentication, I'm using cookies and to fetch user info I just do a get request to an endpoint that return me user info if its logged in or a 401 (Unauthorized) status code if its not. My concern is about, when I get a 401 status code, the chrome developer console print
Failed to load resource: the server responded with a status of 401
(Unauthorized)
It does not cause any bug in the client, just that It bothers me to see it hah.
Create an interceptor in the HTTP requests and upon received response, use the single line code console.clear(); to clear the console output.
In that way, even if you receive 401 or 403 or any response from server and a console error/warning is auto generated, then it will be auto cleared as well!

Cannot receive the http status code 413 for CORS

I have this web application where the web services are hosted on Amazon API gateway & the client application is hosted on cloudefront site. The services are CORS enabled. For any error such as http 500, 401, 403 I am able to receive the http status from the jqxhr object using status property. But it seem that for http status 413 i am getting status 0 in the code.
I have also noticed that http status 413 can be received if the request is made with in the server. But only for cross domain ajax, the status 413 is received as status 0.
Is there any way to handle http status 413 for cross domain ajax request.
Just brevity, consider the following code block, for http status 500, 401 the error callback log's out 500 or 401. But for 413 it displays 0.
$.ajax({
url: 'URL to AWS API Gateway',
success: function(d){
console.log(d);
},
error: function(a){
console.log( a.status );
}
});
See the following http://jsfiddle.net/tqgv7z9c/1/ (note http not https)
$.ajax({
url: 'http://www.mocky.io/v2/57bb03fc100000460a585000',
error: function(a){
$('#code').text( a.status );
}
});
I set it up using http://www.mocky.io/ with the following setup:
413 Request Entity Too Large
CORS Headers
Access-Control-Allow-Origin: http://fiddle.jshell.net
Access-Control-Allow-Methods: GET
You can see the 413 code is correctly returned.
Without seeing more detail on the response you receive, I'd imagine the browser is taking a follow up action, I know this is a problem if a 304 Found response comes back with a Location header, this will cause a new request to occur and you won't be able to intercept before the browser continues. if this is what is happening for you, there is likely little you can do about it if you don't have the ability to modify the API itself.

Failed to load resource: the server responded with a status of 404 (Not Found)?

I am working on Angular-Google-Map API. When I load Google Map frist time it go no error. I have list of markers, when I click on it, gives details like location, address, etc. This details show on one form. When I close form and again click on any markers it gives following error.
I automatically attach .map at end of requesting file. Like angular-cookies.min.js.map. So that requested resource is not found gives following errors. Because there is no file with .map extension at end.
So what reason it add .map extension at every file.
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/static/lib/angularjs/js/angular-cookies.min.js.map
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/static/lib/jquery/js/jquery.min.map
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/static/lib/angularjs/js/angular.min.js.map
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/jquery.min.map
map extension is a way for the browser to "unminify" the minified javascript files, so that on client side, debugging will be easier, without impacting performance. Normally getting this error will not effect anything. Everything will work as expected. But if you don't want to see that ugly errors, you can further explore it from here;

jquery FullCalendar returns http 403 error

I have integrated jquery FullCalender2.2 in my php website. It is working fine with localhost but when I upload it online in my url "http://iamfortesting.com" it returns 403 response. Please help as I am unable to get the issue. Console Log is given below-
Failed to load resource: the server responded with a status of 403 (Forbidden) http://iamfortesting.com/......../fullcalendar.css
same is for fullcalendar.js also.
better you use cdn
//cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.2/fullcalendar.min.css
//cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.2/fullcalendar.min.js

how to find the source code that produce the Resources in Chrome Inspect Element

If you look at the following site http://styles.my/thestar/ , the inspect element using chrome shows a 404 for http://shopping.thestar.com.my/image/.
How can I find or trace back the code that producing this error?
I can see a a 403 error.
Failed to load resource: the server responded with a status of 403 (Forbidden)
Has to be something about permission in the server side. And this is the correct URL for this resource http://styles.my/thestar/image/
Make sure you ask with the correct info :)

Categories

Resources