Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I just wanted to know what PROS and CONS are there when reading REST APIs using Javascript, Pyhton,... what language do you recomend for this task?
I've tried with Python 3.4 but I don't think it is the best decission. I've also tried with Postman but I didn't succeed and I don't want to use google tools.
Thanks
Your question for pros and cons has been already answered by different person in this question.
Basically an application will have front-end and back-end app. All the data logic will go to back-end service and all the view logic (optionally, with some data logic as well, based on project.) will go to front-end service. Front-end applications basically needs data to show to the users which it gets from back-end service (aka api). This communication between front-end and back-end needs to follow same protocol. REST and SOAP are two most popular protocols but I recommend you REST.
Now there are many more REST frameworks like, Ruby on Rails, Django that helps you build back-end service following REST protocol. And then there comes front-end app. Basically, javascript frameworks like angular, react are mostly used to build front-end app. It has advantages over manipulating JSON object response from REST web service (REST api).
Postman is a tool that helps you test REST api's. If you have api-endpoint (like, https://jsonplaceholder.typicode.com/posts/1) and method (like, GET) then you can use postman to GET response from that api.
Front end application adds logic to these response and helps user to visualize the data.
And at last, don't hesitate to google. Because it's all about googling-stackoverflow.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would like to make an action where people can ask the geology at a/their location.
This would make use of GET requests from web services which are made available through the OneGeology Geoportal (http://portal.onegeology.org/OnegeologyGlobal/)
GET requests look like:
http://portal.onegeology.org/OnegeologyGlobal/proxyxml?url=https%3A//gs-seamless.geoscience.nsw.gov.au/geoserver/onegeology/ows%3FSERVICE%3DWMS%26SERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetFeatureInfo%26FORMAT%3Dimage%252Fpng%26TRANSPARENT%3Dtrue%26QUERY_LAYERS%3Dau_nsw_25k_geounits%26LAYERS%3Dau_nsw_25k_geounits%26INFO_FORMAT%3Dtext%252Fhtml%26I%3D50%26J%3D50%26CRS%3DEPSG%253A4326%26STYLES%3D%26WIDTH%3D101%26HEIGHT%3D101%26BBOX%3D-33.689918518066406%252C150.75199127197266%252C-33.620567321777344%252C150.82134246826172&_=1587457888900
Output is
https://gs-seamless.geoscience.nsw.gov.au/geoserver/onegeology/ows?SERVICE=WMS&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=au_nsw_25k_geounits&LAYERS=au_nsw_25k_geounits&INFO_FORMAT=text%2Fhtml&I=50&J=50&CRS=EPSG%3A4326&STYLES=&WIDTH=101&HEIGHT=101&BBOX=-33.689918518066406%2C150.75199127197266%2C-33.620567321777344%2C150.82134246826172
Geoserver GetFeatureInfo output
So would want GA to respond with the "unit_name" attribute = "Londonderry Clay" .
Could someone point me in the right direction to develop such a service?
Would it be simplier if I made a mobile app version of the portal first? Or do I need to make a custom action via Dialogflow from stratch? or a 3rd way?
Well, what would be easier is to work with technologies that you're already familiar with.
Are you familiar with mobile programming? Go that route, although it will be more difficult to integrate voice for other Assistant platforms later.
Understand web programming more and you're used to building back-end services? Building a fulfillment webhook that makes this call from parameters from Dialogflow might be easier.
If you want to learn how this is typically done, and not necessarily go with what's easiest for you, you'll want to go the latter route. This involves
Designing the conversation
Building this conversation in Dialogflow
The specific procedures involved to get user information including specific location
Building a webhook running on a server to process the user input, including their location, making the call to the API, and returning the response to the user
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need to launch an application on a remote system from Java. I know the IP address and the location of the executable batch file on the remote system. I am trying to get it done with PSExec but I can't seem to get it to work due to domain issues.
One suggestion was to use REST API instead. I don't see any info on using REST to launch an application. So anyone who can tell me if this is possible?
REST is about resource state manipulation via their representations on the top of stateless communication between client and server. REST is an architectural style and it's protocol independent but, in practice, it's commonly implemented on the top of the HTTP protocol.
Can I use REST APIs to remotely launch an application?
If you can represent your application state as a resource, so you can probably create a REST API to manage it.
In practice, your server can provide a set of URLs to locate the resources and their state can be manipulated via HTTP verbs and representations such as JSON and/or XML.
HTTP headers can be used to exchange some metadata about the request and response while HTTP status code should be used to inform the client regarding the status of the operation.
Keep it stateless by storing all session context in the client.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have to create an application with a permanent connection (I need to send data update from the server) and, in parallel, I need to configure this app. My idea was to use Socket.IO for the connection and use it also for the configuration, with specifics event name.
But someone said that it's better to keep Socket.IO only for sending data from the server and use a REST API to configure the app.
I want to know if using a REST API along with of a Websocket connection is a good practice or not, and if no, why.
You always can provide a REST API along with a WebSocket API for different purposes. It's up to your requirements and it depends on what you want to achieve.
For instance, you can use a WebSocket API to provide real-time notifications while the REST API can be used to manage resources.
There are a few details you should be aware of:
REST is a protocol-independent architectural style frequently implemented over the HTTP protocol and it's meant to be stateless.
In HTTP, the communication is driven by the client: the client requests and the server responds.
WebSocket is a bi-directional, full-duplex and persistent connection protocol, hence it's stateful.
In WebSockets, once the communication is established, both client and server can exchange frames in no particular order.
Just to mention one example of application that provides different APIs: Stack Exchange provides a REST API along with a WebSocket API.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I would like to have a URI like this /car/toyota, however I don't want the car resource to map to a database table for example. Instead I would like car to just be resource that is used for information retrieval only (ie. no POST, PUT, or DELETE on it), and /car/toyota/ would retrieve that data somewhere else, say through another REST API on another web server that provides this information.
Is this good design?
This probably belongs on something more like https://softwareengineering.stackexchange.com/
That said, this question depends entirely on the infrastructure of the environment you're making your REST requests on. If you have the ability to control the REST API on the web server providing the information, there's really no reason to wrap that API in another API. All of the call forwarding and potential necessity to translate from one request format to another really just adds un-necessary overhead.
That said, if you're accessing an API that you have no ability to re-format, or if you're accessing an API that you don't want client servers talking to directly, then there's a potential design perk for wrapping a different REST API in your own read only API.
Unfortunately, without having a clear picture of the entire architecture and the problem you're trying to solve, it's pretty difficult to decide if a wrapped API is a good design or not. My only advice is the preferred approach would be to edit the existing API if you can, but that isn't always practical.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I studied Amazon web service API reference, I found many services (EC2,Cloudwatch) only support the programming SDK, java/python and so on. Only little services provide RESTful API, such as S3.
I think Restful API is more easier to use than programming SDK. Why Amazon didn't provide the Restful API?
Some may say it just comes down to opinion... but imo, there's no reason to prefer lower RESTful API over SDK, when your language of choice has one.
The SDK's are hand-crafted by AWS to get the most out of their API's (and who would know how to do so better than them?), and give you abstractions that you can take advantage of.
For anything besides a trivial project toying around with AWS, choosing to work with the lower-level API's means that you will end up re-implementing many things the SDK's give you out of the box, aka reinventing the wheel...
The SDK's are there to get you productive and working, fast.
I agree that REST APIs are preferable to SDKs but, actually, all of the AWS services do expose an HTTPS interface, they're just not "RESTful." They call it the "Query API."
http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/Using_Query_API.html
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-query-api.html
Well, in fact, all services of AWS in the SDK communicates with POST/GET.
In the documentation of the AWS services, they provide the url of each action.
The only thing you need to do is read the documentation.
See this S3 documentation which you can see how things works:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingHTTPPOST.html