Questions tagged [http]
HyperText Transfer Protocol - a textual system for representing web requests and replies.
391 questions
1
vote
3
answers
239
views
Should HTTP clients be encapsulated in a C#/.NET library?
I have a C# library that contains all the logic to send requests to a remote endpoint, including marshalling/unmarshalling and encrypting/decrypting requests and responses. It contains an HttpClient ...
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 ...
4
votes
2
answers
309
views
Scope of 400 Bad Request
Here's the description of 422 Unprocessable Entity:
The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415 (Unsupported Media Type)...
6
votes
3
answers
2k
views
How to communicate API Limit between multiple applications?
We currently have 3 Spring boot applications (with multiple instances across machines each) that communicate with an API via HTTP that is not in our hands.
This API has a limit on a per-day as well as ...
1
vote
2
answers
336
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.
...
2
votes
3
answers
281
views
Allowing POST as fallback for GET when query would exceed maximum length of URL
A typical search query looks something like
GET example.com/entity/search?q=John
If we want to add some filtering to this endpoint, we could for example add ...&filter= followed by a URL encoding ...
-4
votes
1
answer
100
views
How to develop portable HTTP clients across js/ts web frameworks? [closed]
Related: Best practice for interoperable TypeScript→JavaScript? - Frameworks, browser extensions
Angular, React, Vue, Svelte &etc. exist and are popular. Some use rxjs to flow from HTTP response, ...
0
votes
2
answers
292
views
Is caching external calls considered a state change in the context of safe HTTP methods
Starting Point:
According to https://www.rfc-editor.org/rfc/rfc9110.html#name-safe-methods, when making a GET call, the client is not requesting and not expecting the call to lead to any state changes....
2
votes
5
answers
3k
views
Pattern Matching on Request Body for Routing an HTTP Request
In an HTTP application, I think about routing requests based not only on the path, but also based on the request body. For an example, think about the following two different body schemas for a PUT ...
1
vote
1
answer
505
views
How to handle different json response for the same api rest endpoint and different http status
I have an endpoint similar to GET ../produtcs/123 where 123 stands for an ID. The REST service response
with either status 200 and a json object A {"deliveryData": {"status": 200, ...
0
votes
1
answer
202
views
Architectural decision regarding at-most-once semantics cron jobs in distributed systems
please note that while I refer to a specific web application framework in the following, the problem also arises with most other web application frameworks I know so please don't be afraid to reply ...
0
votes
1
answer
699
views
POST and PATCH for a nested resource in REST API
One post can have many comments.
How can I design REST API urls for HTTP POST and HTTP PATCH for comments.
My idea is to have the following endpoints:
HTTP GET: /posts/{postId}/comments
HTTP GET (all ...
0
votes
1
answer
541
views
How to view the exact raw HTTP request on Postman? [closed]
When I'm sending a request, the raw log looks something like this:
GET / HTTP/1.1
User-Agent: PostmanRuntime/7.36.3
Accept: */*
Cache-Control: no-cache
Postman-Token: 3d4eba45-388c-462c-a174-...
1
vote
3
answers
347
views
Should this request return a status of 404 or a different status
We have an API that allows clients to POST some request which takes some time to complete, so the API simply places it on a message queue and returns a 202 (Accepted) and a new GUID in the body.
The ...
-2
votes
3
answers
274
views
Why does the HTTP protcol support multiple methods?
This is a question which I have had in the back of my mind for a significant length of time, but never found an answer to, and never thought to directly ask - until today.
I am interested to ...