Questions tagged [rest]
Representational state transfer, or REST, is an architectural style for networking software to transfer information through the web.
                1,592 questions
            
            
            
                1
            
            vote
        
        
            
                3
            
            answers
        
        
            
                272
            
            views
        
        
            
            
            
        How to pass arguments of a complex search in RESTful API request params
                    I’m building an app that lets users manage data across multiple tables. I also expose an API so they can fetch their data and process it in external services.
I’d like to enhance the API to support ...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                176
            
            views
        
        
            
            
        API design: handling multiple user account types
                    I’m designing a REST API where a single person can hold multiple account types.
For example, one person might have both a CareProvider and a CareSeeker account.
Each account type can have its own ...
                
            
       
        
            
                2
            
            votes
        
        
            
                3
            
            answers
        
        
            
                2k
            
            views
        
        
            
            
        POST / PUT with no explicit id in request
                    In the context of POST/PUT endpoints, is it ok to retrieve the id from the authentication token instead of forcing the user to send it via a path variable?
For example, PUT /api/users that updates the ...
                
            
       
        
            
                2
            
            votes
        
        
            
                3
            
            answers
        
        
            
                262
            
            views
        
        
            
            
        Search requests with multiple search values
                    (related: Fetching records matching multiple joined attributes)
If Spring Data doesn't allow GET requests to have a body (and it's considered bad practice anyway)
curl -X 'GET' \
  'http://localhost:...
                
            
       
        
            
                1
            
            vote
        
        
            
                2
            
            answers
        
        
            
                335
            
            views
        
        
            
            
            
        Updating PUT endpoint receiving non-existing id
                    Imagine an updating PUT endpoint receives a DTO that contains an id that corresponds to no record.
{ 
  id: 12345,
  name: "George"
}
Options I see:
Do nothing.
Return an error response.
...
                
            
       
        
            
                5
            
            votes
        
        
            
                3
            
            answers
        
        
            
                430
            
            views
        
        
            
            
        When is multiple validation layers of protection necessary?
                    I'm having a hard time of understanding at what point is multiple layers of validation protection necessary rather than a single point of failure and if the performance hit is a concern
Lets say you ...
                
            
       
        
            
                1
            
            vote
        
        
            
                5
            
            answers
        
        
            
                410
            
            views
        
        
            
            
        Conventions and separation of concerns for controllers
                    I am currently working on a project using .NET APIs and have a few questions regarding controller design. Specifically, I have separate controllers for users and orders, and I am considering the best ...
                
            
       
        
            
                0
            
            votes
        
        
            
                3
            
            answers
        
        
            
                308
            
            views
        
        
            
            
        How does HTML-based HATEOAS apply in applications which also want to expose an external API?
                    I recently read through Hypermedia Systems, and found its arguments incredibly compelling. The book brought a lot of clarity and structure to ideas and frustrations that have been bouncing around in ...
                
            
       
        
            
                1
            
            vote
        
        
            
                1
            
            answer
        
        
            
                422
            
            views
        
        
            
            
            
        3rd party REST API calls in repository pattern
                    For a long time, I’ve been using Repository pattern to abstract data access logic from actual business logic, always using SQL or noSQL databases as my data source.
But how much valid is it, to ...
                
            
       
        
            
                -1
            
            votes
        
        
            
                1
            
            answer
        
        
            
                188
            
            views
        
        
            
            
            
        Which authentication method to use?
                    I have a REST API with protected endpoints, which require an AccessToken for access. For the user to receive the AccessToken, they need to access the login endpoint and with the correct credentials (...
                
            
       
        
            
                2
            
            votes
        
        
            
                0
            
            answers
        
        
            
                145
            
            views
        
        
            
            
        When Should We Separate DTOs from REST API Serialization Classes? [closed]
                    We know that combining a domain entity, a DTO, and a REST API serialization class into one won't pass code review:
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@Builder
@Entity
@Table(name = "...
                
            
       
        
            
                1
            
            vote
        
        
            
                0
            
            answers
        
        
            
                83
            
            views
        
        
            
        Best practice: slightly different logic on multi mapping endpoint
                    Suppose I've got a spring controller as follows:
⋮
@RestController
public class MyController {
    ⋮
    @PostMapping(value = { "publicAPI/addItem", "internalAPI/addItem" })
    ...
                
            
       
        
            
                0
            
            votes
        
        
            
                2
            
            answers
        
        
            
                144
            
            views
        
        
            
            
            
        REST URL taxonomy when sensitive data passed in header
                    If I have a REST endpoint such as /users/{userId}
and I decide to move userId to a header parameter because it is considered senstive data what should the URL now become?
It could be /users/ or /users/...
                
            
       
        
            
                0
            
            votes
        
        
            
                3
            
            answers
        
        
            
                307
            
            views
        
        
            
        Design and communication between microservies
                    To learn about things like microservices, messaging brokers and all other new and fancy things, I decided to create microservices that will let me monitor my base within Minecraft (done via ...
                
            
       
        
            
                0
            
            votes
        
        
            
                1
            
            answer
        
        
            
                491
            
            views
        
        
            
            
        Should you use nested routes within NestJS for a "RESTfull" API
                    Here is an Example API for managing companies, employees, and their children. My entity relationships are as follows:
company -1:n-> employees -1:n-> children
I’ve structured the API routes ...
                
            
       
         
         
         
         
        