percolatestudio / meteor-google-api

A simple API encapsulating some common patterns regarding Google's APIs
https://atmospherejs.com/percolate/google-api
MIT License
48 stars 30 forks source link

delete verb doesn't work #20

Open Zane-XY opened 9 years ago

Zane-XY commented 9 years ago

Trying to delete an event from Google Calendar:

    GoogleApi.delete('calendar/v3/calendars/primary/events/'.concat(evtId), {
        params: {
            sendNotifications: true
        }
    }, callback);

This gives,

DELETE https://www.googleapis.com/calendar/v3/calendars/primary/events/ttgn7mbe0pntuk2j63jk1cooe8 

localhost/:1 XMLHttpRequest cannot load https://www.googleapis.com/calendar/v3/calendars/primary/events/ttgn7mbe0pntuk2j63jk1cooe8. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400.

The insert call is fine,

    GoogleApi.post('calendar/v3/calendars/primary/events', {
        params: {
            sendNotifications: true
        },
        data: evt
    }, callback);

I don't know why the post doesn't throw a CORS error, but a delete does.

tmeasday commented 9 years ago

We don't do anything to deal with CORS in this library AFAIK. You'll have to dig deeper I guess...