I am developing Rest Api using grails. It is working on localhost:8080. when I am calling with POSTMAN it responded with json. I want to use this data and also perform CRUD operation on my web page which is running on other domain. When I am trying to call RESTAPI which is written in grails, the browser is not able to get a response due to Access-Control-Allow-Origin. So how to enable CORS functionality in my REST API, So anyone can access from a different domain.
If you are using Grails 3.2.1 or higher, it comes with CORS support built in.
In your application.yml, add the following:
grails:
cors:
enabled: true
See http://docs.grails.org/latest/guide/introduction.html#whatsNewCors for further details.
Related
The HTTP REST API documentation on the ArangoDB website looks incomplete. I need the full reference documentation so I can implement calls to ArangoDB's HTTP REST API from libcurl for C++.
ArangoDB has Swagger UI, go to Support menu in Admin, then select Rest API tab
You can also download swagger.json and generate API clients and server stubs via swagger-codegen (for C++
is supported cpprest, Qt5, Tizen)
What happens when we do not use REST api to build a web application? And also please tell how to build a web service using REST api in PHP.
What happens when we do not use REST api to build a web application?
Nothing, you can do your project with or without REST API. Assume you are running a restaurant and you want to attach with online food service like Foodpanda,zomato you need to provide an API to interact your data without any user interface which can be done easily using REST.
Why do we need RESTful web services?
REST should be used if it is very important for you to minimize the coupling between client and server components in a distributed application. [read more]
How to build a web service using REST api in PHP?
There are many resources available in internet. Here I found something related to PHP
PHP RESTful Web Service
Is there any way to test rest Webservices in SAP?
I know it's possible to test SOAP Webservices with eCATT but to do that a WSDL file is needed.
The Problem with rest Webservices is, there is no such WSDL file.
Thanks in advance.
I'm assuming from your question that you'd like to test the service from within your SAP system rather than by using an external tool.
If you have access to a system that has the Gateway components deployed, you can use the Gateway client (transaction code /IWFND/GW_CLIENT). It provides a very similar set of functionality to Postman, Paw, et al.
You can use some rest clients available on the browsers:
Postman -> Chrome
RESTClient -> Firefox
Futhermore, if you need a more robust client, you can use SoapUI. See this link.
You may use Fiddler.
Here is detailed instructions on how to test a web service (I know the instructions are for asp.net web services but the Fiddler part should work for any web services).
I am using spring security plugin in my grails 2.3.1 app,
I want to expose my controller as rest api,
So that mobile apps can access it.. so do i authenticate my users through my grails controller
Basic auth over SSL is common for REST APIs, and the plugin docs show how to configure Basic auth for part of the app, and standard form-based auth for user-accessible parts of the app. There's also a new plugin for REST + Spring Security - see http://grails.org/plugin/spring-security-rest and click through the "Documentation" button to see the docs.
I'm working with SOAP based web services that require authentication. I usually use the Eclipse Web Service explorer to explore the offered services but for the services requiring authentication, there does not seem to be an authentication option and I keep getting the 401 response.
I tried online clients as well. There is one at http://soapclient.com/soaptest.html but it also exhibits the same behavior.
When I try to access the web services through the browser I get the username/password prompt and it works.
I have also tried using https://username:password#webserviceURL. Again, this works in the browser but not in Eclipse or the online SoapClient utility.
Any ideas how I can get do this ?
It was pretty trivial in SoapUI.
I also found an online client that works with the http://username:password#webserviceURL pattern. Its at : http://tools.pointbeing.net/wsdlviewer