You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by German Grekhov <ge...@gmail.com> on 2012/04/09 12:28:37 UTC

CORS

Hello!

Does anybody know how to use REST/SOAP API with Cross Origin Resource
Sharing (CORS)? I need to use the API from javascript code on
teambox.com. So, I use ajax requests (or XmlHttpRequest). But it is
the cross-domain request and it is forbidden.

I found a way:
add the header 'Access-Control-Allow-Origin' =
'http://www.teambox.com' to the OpenMeetings API server.

Does anybody know how to do it? Or maybe somebody knows some another way?

Thanks.

Best regards,
German Grekhov.

Re: CORS

Posted by German Grekhov <ge...@gmail.com>.
Niranjan,

thanks for the answer. We have found a decision of using iframe. In
this case, it very useful technology because we could reuse it with
some other integrations but not only with teambox.

German.

2012/4/10 Niranjan Shukla <ni...@gmail.com>:
> Hi German,
>
> You may also have to add headers to indicate which http methods are
> supported by CORS & whether jquery is supported too..
>
> Those headers are header('Access-Control-Allow-Methods: GET, POST,
> ......'); & header('Access-Control-Allow-Headers: X-Requested-With');
>
> i do not know what these Headers default to (in case you do not add them)
> but maybe you will need to add these too?
>
> Best,
> Niranjan
> --------------------------------------------------------------
> On Mon, Apr 9, 2012 at 3:58 PM, German Grekhov <ge...@gmail.com>wrote:
>
>> Hello!
>>
>> Does anybody know how to use REST/SOAP API with Cross Origin Resource
>> Sharing (CORS)? I need to use the API from javascript code on
>> teambox.com. So, I use ajax requests (or XmlHttpRequest). But it is
>> the cross-domain request and it is forbidden.
>>
>> I found a way:
>> add the header 'Access-Control-Allow-Origin' =
>> 'http://www.teambox.com' to the OpenMeetings API server.
>>
>> Does anybody know how to do it? Or maybe somebody knows some another way?
>>
>> Thanks.
>>
>> Best regards,
>> German Grekhov.
>>

Re: CORS

Posted by Niranjan Shukla <ni...@gmail.com>.
Hi German,

You may also have to add headers to indicate which http methods are
supported by CORS & whether jquery is supported too..

Those headers are header('Access-Control-Allow-Methods: GET, POST,
......'); & header('Access-Control-Allow-Headers: X-Requested-With');

i do not know what these Headers default to (in case you do not add them)
but maybe you will need to add these too?

Best,
Niranjan
--------------------------------------------------------------
On Mon, Apr 9, 2012 at 3:58 PM, German Grekhov <ge...@gmail.com>wrote:

> Hello!
>
> Does anybody know how to use REST/SOAP API with Cross Origin Resource
> Sharing (CORS)? I need to use the API from javascript code on
> teambox.com. So, I use ajax requests (or XmlHttpRequest). But it is
> the cross-domain request and it is forbidden.
>
> I found a way:
> add the header 'Access-Control-Allow-Origin' =
> 'http://www.teambox.com' to the OpenMeetings API server.
>
> Does anybody know how to do it? Or maybe somebody knows some another way?
>
> Thanks.
>
> Best regards,
> German Grekhov.
>