Newest rest Questions

Q&A for professional and enthusiast programmers

Hiding multiple web services behind one?

There is a system with a rather big amount of different small services. The idea is to hide them behind one, which is going to be an entry point to the system. Is that considered a good practice? Are ...

Post restful method java error

Can anyone tell me why this error? Server Log: StandardWrapperValve[ws_site.ApplicationConfig]: Servlet.service() for servlet ws_site.ApplicationConfig threw exception java.lang....

POST method not working when called from JQuery using $.post

I'm not really sure why my post method does not work. I think I've set it up correctly too. I have a Rest Controller that accepts the POST method. Below are the codes I used. Any help is appreciated. ...

How to return empty string “” from web api result , instead of null

I am developing a simple webapi for my company. I want to return empty string instead of null. I have googled my question but the answers were quite long. I would like a straightforward answer with ...

“GenerateJavaStubs” task failed using ModernHttpClient

I'm using Modern Http Client in my xamarin forms project to get access on my rest api which is secured with azure active directory. In iOS i have no problems and i get my json data. But in android i ...

Proper way of passing auth params with Angular to Codeigniter REST_Library

So far, while application was in "development mode", i didn't use any request authentication, but now it's time to implement it. Since this is my first Restfull api authentication i'm wondering how ...

what to do if I don't have page specific API call?

I'm using Polymer js,suppose if I have page A,B,C and I request a signin API call in page A and I need that response in page B and C till user signout. so when I get response I store response in a JS ...

ExtJS 6 Rest Proxy where JSON Data Object is ID

I'm hoping someone can guide me on how to deal with this json data structure. Here's an example of that: (I have zero control of this data) { "1": { "name": "thing 01", "...

java.lang.ClassNotFoundException: org.glassfish.jersey.server.internal.inject.ExtractorException

I'm trying to do Image upload using MutipartForm Data and i also achieved it. But my problem is my other rest api methods are not working with Multipart form data. I'm getting java.lang....

I am getting 400 Bad Request for ReST call only in internet explorer

In our running application, one of GET request starts giving response as 400 Bad Request in Internet Explorer. On investigating , I found that GET request doesn't have queryParameters what were ...

CORS related issues in apache server

I am developing a cross platform mobile application using Magento 2 rest apis.I have enabled the CORS in my apache server. /etc/apache2/sites-available/000-default.conf <VirtualHost *:80> ...

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 ...

400 Bad Request - while POSTing JSON data to RESTful controller

I am trying to POST some JSON data to RESTful spring controller. But getting "400 Bad Request" as response status. Giving below code from the key configuration files which I am using for this: pom....

The absolute URL for google endpoints

I'm unable to find the absolute URL for the REST endpoints created by google appengine endpoints sample. The configuration of the web.xml and MyEndpoints seems to be http://localhost:8080/_ah/api/...

How to pass the %0A in the uri template using the wcf rest service

hello everyone I'm trying to create the wcf rest service to upload the comments but my service will work fine if i use the space but when i use the enter or new line (\n or %oA) in the uri template ...

JAVA android client Calling rest api service error HttpURLConnection java.io.FileNotFoundException

i'm trying to calling an aspnet web api in order to retrieve the token.. i call a method authenticate from this method @Override protected Boolean doInBackground(Void... params) {} but i get an ...

How to call a Restfull web service that have basic authentication using Spring RestTemplate

I am using Tomcat7, Sprng framework for restfull web services. I am trying to call an http web service that have basic authentication using Spring RestTemplate. I couldn't get it to work. Can ...

Can't invoke Activity 2 after Activity 1 is saved to database successfully using Restful web service

I've been getting this issue for a long time. It is a process of registering a user, I break it into 2 activities: Activity 1 - RegisterActivity (email, password) Activity 2 - ...

Fetch JSON via REST API using PHP CURL with spring security

I want to retrieve a JSON data via REST API using PHP cURL. Using the PHP code in this post, I was able to bypass the spring security page with the URL: https://<host>/appserver/...

Use .jsp as rest url which does not look for JSP file

I am trying to use document.jsp as REST URL but it is looking for .jsp file instead. @RequestMapping(value = "/document.jsp", params = { "doc"}, method = RequestMethod.GET, produces = "application/...

Unable to subscribe a rxjs response during a get by id call

I'm following the angular2 tutorial and I'm trying to call my real REST api without simulating the web API. When I try to get a single Tune by id I'm unable to subscribe the object and then show it in ...

Android Jersey client java.lang.NoSuchMethodError: No interface method addAll

I'm currently trying to retrieve some server data from a Android application using a Jersey client through the following code: Client client = (Client) ClientBuilder.newClient(); ...

Ignore property transfer in REST header if property is null - SOAPUI Groovy

I'm using a database as a data source to transfer properties and values to my test script in SoapUI. In this case, i have 3 place holders which I'm using as header type and values for my rest test. ...

POST doesn't create object in Java

I am trying to develop a RESTful application that allows the client to add users to a database. This is the User class public class User { private String id; private String name; public User(String ...

Approach to deploy changes to an existing REST API without

I'm looking for some guidance or thought process to help me get a solution, for managing RESTFul API service deployment, in JAVA. The caveats are that - Should not duplicate the entire code base, ...

Why is the TestRestTemplate postForEntity object body null

So my problem is this essentially: http://i.imgur.com/rE0z7Um.png Here is the class that throws the error once the response is called in the @Test method: @RunWith(SpringRunner.class) @...

REST Web Service not working

I am just trying to create a simple test web service. I want to access the User in XML format at the following url: http://localhost:8080/Online_Shopping/dispatcher/rest/hello, but when I go to the ...

Meteor restivus api users collection 'call' of undefined

I am trying to use Meteor restivus to create a simple api. I am trying to use the useDefaultAuth property to retrieve a login token, but I get this error when send a POST with the email and password. ...

JBPM 6.4 Accessing MI sub process variable via REST API

I'm using KIE-WB 6.4 to design a process that contains a "MI sub-process". I have passed a collection of dataObject as an input for the "MI collection input " property. What's the needed ...

Accessing nested data in MongoDB through REST, Spring

Akin to my earlier question, I'm trying to access data in MongoDB using Spring REST. I have collections of simple Key-Value Pairs and can access those fine. { "_id" : ObjectId("...

How does React server-side rendering deal with RESTful API (react-router+express)?

I've got a problem with react SSR. I use react-router as my app route manager. In the server side, it may look like this (server.js): var app = express(); app.get("*",function(req, res ){ ...

C# WCF: Get Requesters URL

I have a C# WebService called via ajax (javascript). Is it possible to retrieve the requesting URL? Example: test/index.html calls the WebService via "GET". Can I retrieve this calling URL (test/...

REST service deployed on jetty with Web.xml

I am new to Rest.I actually wanted to create a rest service embedded in jetty. I have gone through many sites which either gave examples of Rest service developed on jetty server with servers ...

What is the best practise for REST URLs in querying is reserved or is exist

I have API for booking system. Two basic entities:- Booking and Property public class Booking { public DateTime CheckInDate {get; set;} public DateTime CheckOutDate {get; set;} public int ...

How to test rest webservices which are provided by vendor or external system

Is there any dynamic framework to do the unit testing with java for rest based web services. I searched in the google, everywhere I found server side Java class in the Junit classes like below: @...

Lowercase enum values from API to Mongo with Spring

Using Spring Boot, I'm exposing a REST API that accepts my domain object as a JSON body and attempts to persist it to a Mongo Document. How can I accept lowercase values of this enum in the JSON ...

Spring, java and mongodb

I am still beginner at spring, Mongodb and Java. I am trying to design an application enables the user to make the following actions: Add new customer. update existing customer data. Search a ...

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 ...

How to set Etag when returning Custom Objects in Jersey?

I want to setup Etag and Last-Modified header for my APIs. Currently my APIs are returning Objects (say a Person object). I have searched the Web but couldn't find a way to implement Etags without ...

Call different slim framework URL/REST API under the hood?

Let's suppose I've two REST services: 1) one for authentication purpose only -> This has /login endpoint 2) second for other purpose -> This also has a /login endpoint, but I want to call service ...

Reading a JSON response from REST API always returns empty text

I hope all is well and I appreciate if you can help me or re-direct me to a similar old post because I couldn't find one. I'm trying to initiate a REST API request and the server will send a JSON ...

nodejs request x-csrf-token failed

I am new to Nodejs and Request library. I want to use a Get request to get x-csrf-token from server, then use that token for my Post request. Please see any wrong with my code below. The get request ...

Python Bottle rest headers not working with underscore

I am facing issues for rest headers with underscore, not getting the rest headers value while i am printing them. Did someone have any idea of how I could make this work ? Thanks!

prop is returning null

I'm not sure why this prop this.props.event.Who.Name at the end of my form component is returning an error when the page loads, considering the prop field Location is null. I'm importing data from a ...

Not able to read value from properties file in Spring Boot using @Value annotation

I am not able to read a property from properties file through Spring Boot. I have a REST service which is working through the browser and Postman both and returning me a valid 200 response with data. ...

Xamarin update Data with PUT in Rest

I'm trying to update data in REST with Xamarin. The problem is that i dont know how to update specific data of an object. My Json which i get from REST looks like this [{"id":1,"name":"John","Hobby":"...

Microsoft Access Token Request Error - 400 Bad Request

I am trying to get access token from access code. but there is a error of 400 Bad Request error I am using this link to get Access code https://login.microsoftonline.com/common/oauth2/v2.0/authorize?...

Sorting rest get request results by field passed as a parameter

I am currently working on a Rest API, in a get method which suppose to return an Array of objects in json format I now have the requirement to sort the result by a field passed as a parameter to the ...

spring boot rest keeps looping

My method in my rest controller keeps looping. The method is supposed to get a project from the Mongo database then call another API to get some data and save it again in mongo. It works but it just ...

Java EE / AngularJS : Tomcat? [on hold]

I'am learning Java EE web developement and I have some questions : 1) What is Beans ? and can I use them with Spring MVC ? 2) What is the difference between Spring MVC and Spring boot ? 3) I ...
Translating... 0%