org.springframework.web.client.RestClientException

I get the following exception when I try to get User from my Web Service. org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.shopping.model.User] and co...
more »

2017-02-19 23:02 (1) Answers

Convert Linux Curl to PHP

I've been trying all week to try and enable connection to my web service using PHP curl, however, I couldn't make it work so I tried curl using command line and to my surprise.. it worked. Here's the command that I used using the linux curl: curl -...
more »

2017-02-19 17:02 (1) Answers

Rest WebService for performing business operation

As I've read, Rest is used for create/update/delete/get of Resource using PUT/POST/DELETE/GET method. Now Let's say, I've to expose a service which take 'price' and 'date' as request and it calculates 'service tax', 'sb cess', 'krishikalyalcess' on ...
more »

2017-02-19 03:02 (2) Answers

Ask server to delete record

I'm pretty new to web development, so bear with me. I've also simplified the code to try to get the best answer. <a href="/item/1">Item</a> <img src="x.png" alt="Delete"> Basically, if someone clicks "Item" they get taken to /ite...
more »

2017-02-18 23:02 (2) Answers

Hibernate insert error

Error message: javax.persistence.RollbackException: Error while committing the transaction I'm having trouble saving user data. This error has appeared, it follows the form that the project is in: Method to save: public void save(User u)...
more »

2017-02-18 19:02 (1) Answers

Python connect to rest api

i want to connect to a rest api with the following code: data = requests.get("http://pbx/rest/login").json() head = {'loginType' : 'Internal','nonce' : data["nonce"], 'secret' : (hashlib.sha1((LOGIN_ID+data['nonce']+PASSWORD).encode('utf-8')).hexdig...
more »

2017-02-18 13:02 (1) Answers

PHP Login REST API

I'm trying to create a REST API and looking for a way to login using PHP, the documentation provided a login example using Python but I don't have an idea how to do this using PHP. I'm thinking if there's a PHP version of the Python code below. See ...
more »

2017-02-18 10:02 (3) Answers

Geoserver Rest API update workspace name

I am trying to update workspace name through geoserver rest api using put method. I am getting "Can't change the name of a workspace." error. This is my code. $service = geoserver_url; $data = "<workspace><name>testnew</name>&...
more »

2017-02-18 04:02 (1) Answers

Using cURL with large data files

I have this cURL command to run: curl -X POST -H "Content-Type: application/json" -u "{username}":"{password}" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/{solr_cluster_id}/solr/example_collection/update" --data-bina...
more »

2017-02-18 03:02 (0) Answers

Consume REST Web Service from relative uri

Is it possible to consume a RESTful web service from a relative uri, instead of an absolute? When I run the following code, I get an exception java.lang.IllegalArgumentException: URI is not absolute. RestTemplate rt = new RestTemplate(); User x = r...
more »

2017-02-17 21:02 (1) Answers

Rate limiting signup API

We are are small start up and we are using SailsJS(which sits on top of NodeJS) on our backend. Ours is a API driven architecture. I want to implement rate limiting for most of the API's. I want to start with a small use case for Signup. Signup is a ...
more »

2017-02-17 20:02 (1) Answers

Handling missing data in API call

I have a route handler that requires some data (car.name) be passed to it in order to serve its function. carRouter.route('/create') .post(carController.create) function create(req, res, next) { const carInstance = new carModel({ activated:...
more »

2017-02-17 20:02 (1) Answers

How to document REST services in Spring boot?

So, I have been looking at documenting my services in Spring Boot... I have found that Spring Boot has some documentations OOTB in the form of HAL links and ALPS metadata. But, it seems these two only document 'dynamic REST endpoints' created on sta...
more »

2017-02-17 15:02 (0) Answers

Securing API for a Frontend Website

Our APIs (delivered by a third party) are using Tokens in order to ensure authorized access only. Our new website should not be server-to-server but mostly front end, i.e. the token would be visible in the script. We're now checking how to secure the...
more »

2017-02-17 12:02 (1) Answers

Get product details in JSON format using REST API

How to get the product details in JSON format using REST API in Magento2? When I search I found the following code. $url = 'magentohost url'; $callbackUrl = $url . "oauth_admin.php"; $temporaryCredentialsRequestUrl = $url . "oauth/initiate?oauth_cal...
more »

2017-02-17 07:02 (0) Answers

Cross-Site Forgery on Auth Key in header?

I'm currently building a cloud API that will require an Authorization header in every request to the server. The header will contain an API key generated and stored on the server. I will not be checking cookies on the server, only the header. On the...
more »

2017-02-16 18:02 (0) Answers