Questions tagged [restful-url]

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

https://en.wikipedia.org/wiki/Representational_state_transfer

1351 questions
10
votes
2 answers

Rest URL Standards - Multiple Path Parameters

We are building a restful service for serving employee data. We have an api which will return the list of employees who belong to a specific department of a client. This api takes 2 parameters - clientId and departmentId As per standards which of…
10
votes
2 answers

Why does including an action verb in the URI in a REST implementation violate the protocol?

I'm finding it necessary to understand why including action verbs in the URI violates the REST protocol for URI syntax? When I read the following article, I sense that too many people are making too much noise about verbs, and that they should be…
user4903
9
votes
2 answers

does REST discoverability and HATEOAS imply that you can change URIs?

I'm trying to clarify a concept related to REST discoverability - that is whether or not satisfying the HATEOAS constraint for a RESTful service means that now the URIs can change, because they are discoverable and not documented. That seems to not…
Eugen
  • 8,523
  • 8
  • 52
  • 74
9
votes
3 answers

URL design for an API

I'm working on a private apis for our backend. I have collections that have associations. Each collection can be requested, paginated, you can also ask for the associations and paginate this associations. We're not sure about which URL design to use…
Mike
  • 5,165
  • 6
  • 35
  • 50
9
votes
2 answers

How to handle huge data from a REST service

We are using a REST service that returns huge data. In production, the server hardware can handle it. I need to test the REST service by getting the data on my local machine, which cannot handle the huge data. My local machine is a 4G i5. I am…
om39a
  • 1,406
  • 4
  • 20
  • 39
8
votes
3 answers

Should return empty list [] 200/204 or 404 in a Restful API design?

For example, there's a restful API GET http://luexu.com/users/{page} to list the users in Nth page. Suppose there're 20 users in each page. There're 100 users total in the database. GET http://luexu.com/users/5 returns the 80th to 100th users. So…
AarioAi
  • 563
  • 1
  • 5
  • 18
8
votes
5 answers

Is it legal to have REST resource such as /currentUser in terms of RESTful and stateless?

In terms of RESTful and stateless it's pretty legal to have resource like /users/123 But, the question is: is it legal to have resource that omits user id and assumes that it's implicitly resolved on the server from the user session? For…
Wojciech Wirzbicki
  • 3,887
  • 6
  • 36
  • 59
8
votes
2 answers

Jersey with Struts2

I am using jersey with Struts2. But by RestFul Service calls are not working. Below are my configurations files struts.xml
Kalyan Raju
  • 611
  • 4
  • 10
  • 24
8
votes
2 answers

How should exceptions be handled in a RESTful API for collection results?

We are designing a RESTful API to return collections of documents. Our initial implementation uses HTTP status codes to indicate if a request could not be fulfilled. This seems to be a widely accepted best practice (see for example here). We…
Joe Alfano
  • 10,149
  • 6
  • 29
  • 40
8
votes
2 answers

REST - Creating Nested Resources with single POST

Thinking in a RESTful way, is it correct to use POST to create in a single call a resource and its sub-resource? In my application I have the resource /notices/{notice} and sub-resource /notices/{notice}/photos/{photo}. A {photo} can't exists…
user1781028
  • 1,478
  • 4
  • 22
  • 45
7
votes
5 answers

Validate/Change Password via REST API

I want to change a user password via a REST API. This is not a forgotten or reset password function, but a logged in user wanting to change their password. The form requires the current password, the new password, and a confirmation for the new…
Kareem
  • 844
  • 2
  • 8
  • 15
7
votes
3 answers

Multi-lingual REST resources - URL naming suggestions

Is there a REST best practice for GETting resources in different languages. Currently, we have www.mysite.com/books?locale=en I know we can use the accept-language header but is it better for us to do www.mysite.com/books/en or…
Ilyas Patel
  • 400
  • 2
  • 11
  • 27
7
votes
1 answer

Scheduled EventBridge rule targeting API Destination

Is it possible to create an EventBrisge rule which can be scheduled to run at a certain time of day and call an API as a custom target? It seems as though a schedule can be setup for targets if they are AWS or Partner services, but not if they are…
Matt W
  • 11,753
  • 25
  • 118
  • 215
7
votes
3 answers

How to return an Image to browser in rest API in JAVA?

I want to an image while I hit an API like localhost:8080:/getImage/app/path={imagePath} While I hit this API it will return me an Image. Is this possible? Actually, I have tried this but it is giving me an ERROR. Here is my…
Sharvil
  • 247
  • 1
  • 6
  • 15
7
votes
2 answers

Query Azure SQL Database using Rest-API

I have a SQL database server in Microsoft Azure. I want to use Azure Rest-API to select some records from a table. When I refer to Azure SQL Database REST API I can't find any section for this purpose, just I can get a DB information, server info or…
Sohrab
  • 1,348
  • 4
  • 13
  • 33