Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CORS set custom headers #4

Closed
pmig opened this Issue · 1 comment

1 participant

@pmig

Hi,

I try to call the perfect api over javascript. It's wokring with jQuery.ajax(), but I want to call it from angular.

Chrome always rejects the request and transform the method to "OPTIONS", probably because I cant set the the following headers for the repsonse:
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'origin, x-requested-with, content-type, accept',
'Access-Control-Allow-Method': 'GET, POST, OPTIONS, DELETE'
.

Is there a way to do it?

Result:

Console

perfectapi

Angular Request

perfectapi2

jQuery Request

perfectapi3

Note:

the webserver already serves my javascript files with theese custom headers.

@pmig

I switched to Express 3.0 - it's probably the best thing to do, because of lacking support / time.

@pmig pmig closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.