Is there support for CORS in the BigQuery client-side JavaScript SDK? Specifically, can a user make a request inside of my app that their gets data from BigQuery, without having to proxy the request to avoid CORS?
Yes.
The BigQuery API is a normal Google API, and Google APIs support CORS. If you use the full Google APIs JavaScript client, then this will be handled for you, and it will just work.
If for some reason you don't want to use the complete Google APIs JavaScript client, this page discusses how to do CORS manually, using just the auth portion of the library:
https://developers.google.com/api-client-library/javascript/features/cors
But using the complete JavaScript library will be easier, so I recommend you do that.
Related
I am new in nativescript app development, I want to use SOAP web services in nativescript, i.e how to implement SOAP request & response in nativescript. Please give me suggestions, didn't find any way to implement SOAP, all search results are implemented in JavaScript code.
I do open github issues, please check - https://github.com/NativeScript/NativeScript/issues/2284
Thanks :)
Well, their is no built in soap handling. However, you can make you own in a couple steps.
NativeScript has built in http requests, and XMLHttpRequest and Fetch; this means you can query and receive back data you want from any service url. http://docs.nativescript.org/api-reference/modules/http.html, https://docs.nativescript.org/cookbook/fetch, http://docs.nativescript.org/cookbook/http
In addition, their is a third party plugin called nativescript-apiclient which makes it easier to deal with http requests with changing parameters. (i.e. http://somewhere/getdata/{token}/{data} where you can just pass in a token and data value...) See http://plugins.nativescript.rocks for different plugins available.
NativeScript has a XML parser built in, Soap responses are typically XML based. So you can easily instantiate the xml engine to parse your soap requests (http://docs.nativescript.org/cookbook/xml-parser)
I have made a very simple Web API in C# which does all the functionality required and have also made a simple User Interface in Appcelerator (Java Script). My task is to connect these two together so the app has the functionality of the API. I believe I must use JSON to communicate between C# and Java Script but I'm not sure how to do this.
Can anyone help or point me to the right direction?
Thank you
You can write your own API implementation in javascript that talks to your restful service via http calls.
Also, I recommend taking a look at this project here: https://github.com/viezel/napp.alloy.adapter.restapi which can save you a lot of time doing so.
The language in which your web API (service) is written is irrelevant to the question. You can use Ti.Network.HTTPClient to connect to any web service.
You just need to know what requests the API requires and how it responds. Most APIs nowadays use REST JSON, which means you request via an URL with optional body (for POST/PUT calls) and the response is in JSON format which you can parse using JSON.parse
I'd like to use the Feedly Cloud API, but I'm hoping to build my app in a pure client-side fashion. From what I can see on the Feedly developer docs, there is no client-side JavaScript library available to access the API. This seems strange to me, since the API is RESTful and serializes to JSON.
Why is there no pure JavaScript client for the Feedly Cloud API that runs inside the browser?
Is there some kind of technical limitation caused by OAuth or the design of the Feedly API that prevents a client from connecting strictly through the end user's browser?
If it is simply an issue of "nobody has built one yet", that's fine. I just want to make sure that I'm not doing something crazy before I write a JS client.
I'm looking for a nice pattern that woud help me to fully sign my api calls with javascript (here for some example, vimeo) after some oauth connect retrieved authorization identifiers.
Using ruby with omniauth, what I'm looking for would be to retrieve the url that gets called when you do a ModelName.{generateTokenMethod}.request(:get,{url})
It is possible. There are a handful of oauth 1.0a libraries for javascript (You could try looking at some node.js code as an example).
The problem with using oauth in client-side javascript is that it will expose your client secret to anyone using your web service.
Anyone who has your client secret can make requests on behalf of your application, and lure users into generating access tokens by masquerading as your application.
On this page: http://code.google.com/apis/accounts/docs/OAuth2UserAgent.html Google gives instructions for doing oauth with client side applications that talk to their apis.
One step is to call their token validation api. But if I want to do this from javascript, it would require an ajax request which is cross domain.
It seems like with all the improvements to cross domain stuff recently this should be possible, but I'm not figuring it out. Any pointers would be helpful.
If you want a completely browser-based solution, you should consider using the Google APIs JavaScript client. Here is the documentation on how to do auth using that library: https://code.google.com/p/google-api-javascript-client/wiki/Authentication