Skip to content

Instantly share code, notes, and snippets.

@tylergaw
Created April 26, 2015 20:34
Show Gist options
  • Select an option

  • Save tylergaw/310329da6173d215c8a0 to your computer and use it in GitHub Desktop.

Select an option

Save tylergaw/310329da6173d215c8a0 to your computer and use it in GitHub Desktop.
Dribbble API CORs request standard XMLHttpRequest vs. jQuery $.ajax

I'm attempting to make CORs requests to the Dribbble API v1. I can do so using a standard XMLHttpRequest, but cannot using jQuery's $.ajax.

I'm trying to determine if I'm just doing something wrong with the jQuery request, if jQuery is doing something wrong, or if the Dribbble server is missing some bit of CORs configuration.

Here is a working example showing two different CORs requests: http://jsfiddle.net/thegaw/pec38u18/

One thing that is sticking out to me is that the jQuery request is setting the following header:

Access-Control-Request-Headers:accept, authorization

I'm wondering if the accept header is not allowed by the Dribbble API server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment