1
vote
2answers
82 views

Should a REST interface include the query ID as part of the response?

I am currently working an Android app that receives most of the displayed data from a REST interface. First, I request the information for a company the request includes a list of store IDs. With ...
3
votes
2answers
179 views

Shoud I directly return a string message or rather a i18n key when dealing with JSON api?

Suppose a rest api returning this json: { "status" : "fail", "data" : { "title" : "A title is required" } } Since the client application would always adapt the error message, would it be ...
5
votes
3answers
2k views

Is it OK to return HTML from a JSON API?

On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON. The client consistently ...
5
votes
3answers
2k views

Can a webservice that uses JSON over POST be classified as RESTful?

Recently I have started using a new(to me) paradigm for web services. I use the controller to accept JSON strings sent over POST, process it and return JSON strings. GET, PUT, DELETE and other methods ...
24
votes
10answers
5k views

RESTful API design. What should I return if there are no rows?

I'm currently coding an API for a social network with the Slim Framework. My question is: What are the best practices when there are no rows to return in the json structure? Lets say that this call ...
0
votes
1answer
267 views

Recommendations on what technology to use to call REST API [closed]

I'm creating a small web-site that needs to call a REST API to retrieve some JSON and display it. What is the best tool for this job? There are so many Javascript libraries available now it is ...
2
votes
2answers
797 views

Which is simpler for REST client call to return JSON - JQuery/JavaScript or Spring RestTemplate? [closed]

I've been trying to hack up an annotated Spring MVC web app but it's proving pretty hard to call a URL of my web app which fires a request to a remote API (UK Police data) and recieves a reply which I ...
3
votes
1answer
2k views

Should web service response use a base class or generic class?

In my RESTful WCF web service I have something like the following response object. public class WebResponse<T> { public bool Success { get; set; } public T Data { get; set; } ...
4
votes
4answers
4k views

Always return single objects in an array for REST API JSON payloads?

For a REST API that I am working on, I want to return JSON in a consistent layout: { "Data" : { "Id" : 123, "Email" : "charlie@somewhere.com" "Firstname" : "Charlie", "Surname" ...
3
votes
2answers
4k views

xml parser vs JSON parser performance in Java / C / C++

I am trying to understand which data format is better on embedded device communicating with Server over REST API. XML or JSON?. Is JSON parsing faster than XML parsing in Java / C and C++? I ...