Exposing an HTTP proxy through a Turbogears controller - turbogears

I have a webapp implemented in TurboGears 1.1 that's kind of a front-end for a REST API. I'm trying to expose a URL path on my webapp that's a proxy to the original REST API, so I can access "http://MY_APP/rest_api/foo" and have it work the same as "http://REST_API/foo".
Is there a simple way to set that up with TurboGears, or do I have to expose a normal controller and write all the code to handle GETs and POSTs and params and redirects myself?

Related

Inspect the internal Rest API calls programmatically - similar to chrome network xhr tab

Assume I am a client accessing the REST API exposed by a website xyz.com.
Now when I make a call to their REST API I need to find out what are all the internal APIs they are accessing.
For example, xyz.com/users/id may be internally accessing xyz.com/users/id/info.
To explain this better, consider the Chrome -> Network tab(XHR). You can inspect all the Rest APIs that are invoked. Is there any such tool or API that is available?
Understand that I don't have access to xyz.com related code, server, logs and deployment.
Thanks

Where to get the base URL for rest service?

I'm learning REST connector in data factory , I'm trying to create a linked services with REST, but it needs to provide base URL ,I wonder where I can get this.
We can use many programe languages to build a REST Service. When you have permission to access this api, it will return a json object or json object array.
For example, using Spring to build a RESTful Web Service. In this case, http://localhost:8080/ is your base url. If your domain is localhost, you need to use self-hosted-integration-runtime to connect to your local server.

Set $default route in API gateway for REST APIs

I have some REST APIs my backend server listens for (I used node express).
I want to use my friendly url api.mywebsite.com to forward all routes to horribleuglybackendname.aws.com, e.g.
api.mywebsite.com/some/route -> horribleuglybackendname.aws.com/some/route
I want to use API gateway to simply forward any routes to my backend. If I create a HTTP API (not REST) this seems easy to do but if I create a REST API I cannot see how to configure it. Perhaps you can't? If you can't why not? What is the alternative?
Thanks
So it seems $default is for HTTP APIs only. The UI is different between HTTP and REST API configuration. If you want to do a catch-all route for REST APIs you need to use {proxy+}.
This is good (ctrl-f for catch-all and you should be set)
https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/

How to provide rest api configuration or manifest as swagger json for soap ui to parse rest endpoints?

I am trying to implement Soap ui for automating testing of my Rest web service. I found out that we have to either provide the service url or provide a manifest file like swagger.json to soap ui.
My requirement is i want Soap Ui to get all of my rest endpoints without supplying it one by one. Now my question is, Is json file like swagger.json the only option for supplying endpoints config to Soap Ui.
In short, I want to know the enterprise level approach for soap ui implementations for automation testing of Restful web services.

What is the benefit of RESTful Web Service Vs Using Just a simple Servlet?

Regardless of whether I create a RESTful Web service to be consumed by Ajax in my own pages, or by any user, I can provide the same functionality (data) to the application or user using a simple servlet.
I mean the user or application don't see any different between response provided by a simple servlet or respone provided by a RESTful web service. So, I'm guessing that the benefit is on the server side and to the developers. Can someone please tell me what are the benefits of using RESTful web services.
I appreciate any respone
By definition a webservice is intended to be consumed by any client granted access. If the client you are developing is the only application that you will ever need or want to access the resource then there is little benefit to creating a webservice. However, if you want to make the resource available as a service endpoint for more than just this application in a way that is implementation agnostic then a Restful webservice is a great way of doing it.