In the HTML5 Announcement, there is one section mentioned that:
“If your app makes calls to web servers, using API’s like network.request(), because of JavaScript cross-domain scripting rules, you can’t directly call REST type APIs. Instead you will need to write a local web script on the same domain that will make your REST API calls and then echo the returned data back to network.request().”
So, is there any sample or example code of using network.request in HTML5 build in this way above ? Such “write a local web script” and then how to integrate the local web script with network.request?
I’m not sure this is entirely true depending on the API you are using, especially in regards to service based APIs. I am able to query against AWS fine locally. It depends on the back end service and how they handle authentication, which is generally through the use of headers.
Are you wanting to call a service based API or are you making your own?
You can give it a test with network.request like @Rob Miracle suggested. If that doesn’t work try putting the html build up in an S3 bucket as a static site.
I’m not sure this is entirely true depending on the API you are using, especially in regards to service based APIs. I am able to query against AWS fine locally. It depends on the back end service and how they handle authentication, which is generally through the use of headers.
Are you wanting to call a service based API or are you making your own?
You can give it a test with network.request like @Rob Miracle suggested. If that doesn’t work try putting the html build up in an S3 bucket as a static site.