javascript - Cross domain calls, REST library - Stack Overflow

I'm trying to use an external REST Library for my application, and I'm hoping to keep it clie

I'm trying to use an external REST Library for my application, and I'm hoping to keep it client side, with javascript. I have no control over the REST library servers, so I cannot modify any access rights or anything on the servers. (It's kept secure by OAuth).

My question is: Is it possible to connect with the REST API using only javascript? I'm bound to running into cross domain call problems. Using JSONP is not possible from what I gather, since I would only be able to do GET's and not POST's, right? Also, I don't know a lot about JSONP...does it perhaps require me to make some changes on the API-offering server too?(in which case I can't).

Is there a way to workaround this problem, or will I be forced to do some serverside programming?

I'm trying to use an external REST Library for my application, and I'm hoping to keep it client side, with javascript. I have no control over the REST library servers, so I cannot modify any access rights or anything on the servers. (It's kept secure by OAuth).

My question is: Is it possible to connect with the REST API using only javascript? I'm bound to running into cross domain call problems. Using JSONP is not possible from what I gather, since I would only be able to do GET's and not POST's, right? Also, I don't know a lot about JSONP...does it perhaps require me to make some changes on the API-offering server too?(in which case I can't).

Is there a way to workaround this problem, or will I be forced to do some serverside programming?

Share asked Jun 26, 2012 at 13:21 Henrik Kjus AlstadHenrik Kjus Alstad 6842 gold badges10 silver badges24 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 2

There is CORS for modern browsers. Then there are a couple of other hacks, described very well here: Ways to circumvent the same-origin policy.

Otherwise you'll have to do the server side programming.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744815840a4595320.html

相关推荐

  • javascript - Cross domain calls, REST library - Stack Overflow

    I'm trying to use an external REST Library for my application, and I'm hoping to keep it clie

    2天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信