Skip to main content

Questions tagged [http]

HyperText Transfer Protocol - a textual system for representing web requests and replies.

Filter by
Sorted by
Tagged with
2 votes
5 answers
2k 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 ...
Jonathan Herrera's user avatar
0 votes
1 answer
154 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, ...
surfmuggle's user avatar
0 votes
1 answer
126 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 ...
dfsg76's user avatar
  • 109
0 votes
1 answer
223 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 ...
Aleksander Chelpski's user avatar
0 votes
1 answer
179 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-...
DevelBase2's user avatar
1 vote
3 answers
241 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 ...
JoelFan's user avatar
  • 7,091
-2 votes
3 answers
251 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 ...
user3728501's user avatar
-2 votes
1 answer
345 views

Go’s answer to c10k problem

I have few questions on the go's answer to c10K problem. How is an event loop different from the network poller described in this blog? I see a striking similarity between waiting threads and waiting ...
ProgramCpp's user avatar
2 votes
1 answer
323 views

What really is a "web server" in relation to popular frameworks like Flask, Node.js, Apache?

In Flask you can run a "webserver". Well really it's a "WSGI Server". Well really you shouldn't be using core server features like serving files through HTTP at all, you should be ...
Leftover Salad's user avatar
0 votes
6 answers
541 views

Can a web server accept a plain test file upload without additional server side scripting?

I've been trying for days to upload plain text files to a web server (both IIS and NGINX) via HTTP PUT/POST, from a C# desktop app, unsuccessfully However, I'm no further along. I have had various ...
mountainred's user avatar
0 votes
1 answer
152 views

When to use PUT vs POST while calling APIs?

GIST: PUT is idempotent PUT is used for updating/creating a resource. POST isn't idempotent. POST is used for creating a resource. So, I'm wondering what should I use in this case and why? I want to ...
tuck_y's user avatar
  • 181
0 votes
1 answer
210 views

HTTP redirect vs JS redirect

I have a Svelte web app exclusively for internal use, so there is no main landing page or registration, as accounts need to be created by the admin. Since the main page has no function as an ...
Jeremy Meadows's user avatar
0 votes
3 answers
499 views

Is it appropriate to use PUT for resources when the id is deterministically derived from immutable properties?

I'm working with a RESTful API where a POST operation is used to create a user. A required field, which could be an email or a unique user nickname, is unique across the system. The response to this ...
Sergey Kolesnik's user avatar
0 votes
3 answers
1k views

How to combine epoll + multithreading in an HTTP server

I'm building an HTTP server in C using epoll and pthread. The idea is to have an event loop in the main thread monitoring file descriptor and a thread pool to handle computationally-expensive ...
Richard H. Nguyen's user avatar
-4 votes
1 answer
283 views

Web applications, cookies and GDPR

... or technology stack for compliant web applications. GDPR among other includes cookies usage defining four cookie types: strictly necessary cookies , preferences cookies, statistics cookies, ...
user avatar
1 vote
2 answers
230 views

Best way to protect action links from CSRF

An application has a multifactor login. The user logs in with its e-mail and password, and then the following screen asks for a one time password received via e-mail or generated by a mobile app. In ...
user2190492's user avatar
0 votes
0 answers
1k views

How inter-process communication is handled on .NET Core?

I have to implement a bi-directional communication between two local process with support to backward compatibility .NET Core/NET Framework and platform architecture x86/x64. The options that i have ...
youssef jirari's user avatar
1 vote
3 answers
751 views

What sort of http error code to return when the request is bad AND there is an error on the server?

Some of the checks I make to validate http requests involve making a call to an external service to parse part of the request body. These calls can fail because of network connectivity issues. My ...
Benjamin Berman's user avatar
1 vote
1 answer
2k views

How could creating symlinks/aliases to files on S3 work, while still taking advantage of CDN optimizations?

I am trying to imagine a website/system where only 1 copy of a file is ever stored, but multiple users get their own custom link to the file, and it uses the CDN features. For this question we can ...
Lance's user avatar
  • 2,607
1 vote
1 answer
302 views

Best practise for designing REST API endpoint that accepts a nested resource POST

What's the recommended design for an endpoint that accepts a nested resource as the following: POST /account { "name": "Project John Doe", "description": "...
user2190492's user avatar
4 votes
3 answers
1k views

Error or not error?

I need to implement the following scenarios at the server: User sent too many answers in a given amount of time, for example, it can't submit more than 3 posts within an hour. User sent answer with ...
Anatoly's user avatar
  • 264
0 votes
1 answer
53 views

Handling resource not found

I have an endpoint GET home/{homeId}/laptops . Its response is : {"homeId":string,"laptops":string[]} If homeID does not exist I can return '404 Not found' OR an empty response ...
Cap Barracudas's user avatar
-2 votes
2 answers
6k views

What are the possible *root causes* of a SocketTimeoutException?

I understand that a SocketTimeoutException (I'm in Java, but I guess it's the same in just about every major language) happens after a server or client doesn't respond after a period of time, let say ...
Mickael Bergeron Néron's user avatar
0 votes
0 answers
279 views

Returning header Location on POST with no content

I am designing an API that some operations may take a while, for example, creating a backup (not the actual case). I am planning to have an endpoint to query the current job http GET /api/v1/jobs/{...
Skhaz's user avatar
  • 101
1 vote
4 answers
2k views

Design REST Polymorphic API

I have a client/server application that exposes data and commands through REST APIs. This API exposes a GET /recipes/:id endpoint that instructs the client on how to show a recipe. A recipe can be ...
Carmine Ingaldi's user avatar
0 votes
1 answer
342 views

Is it a good idea to have conditional sync/async HTTP API

The api has one endpoint with some parameters. Based on these parameters I can predict how long the processing of the request would take. It can go from seconds(s) to tens of seconds. When expected ...
Rugnar's user avatar
  • 103
1 vote
3 answers
3k views

Is a 422 response ever appropriate for a GET request?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 The HyperText Transfer Protocol (HTTP) 422 Unprocessable Entity response status code indicates that the server understands the content ...
jcollum's user avatar
  • 229
2 votes
1 answer
2k views

Does it make sense to add an additional REST API to access a database?

I've recently joined a startup that has, in my opinion, a strange (and inefficient) way to access their database. Their implementation consists of multiple REST APIs that are exposed to multiple ...
Chromz's user avatar
  • 33
-1 votes
1 answer
584 views

Should I use http status code 402 in my api specification for api methods that allow payment?

According to the MDN the http protocol has the 402 status code: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses And is used for methods that require payment. Also RFC ...
Dimitrios Desyllas's user avatar
-1 votes
1 answer
650 views

Securing http communication between backend services [closed]

What is a good way to secure http communication between two backend services which are not hosted on the same network? One way might be to have a shared secret in both services but I feel like that is ...
mismaah's user avatar
  • 129
-1 votes
1 answer
161 views

Should micro services follow HTTP verbs precisely?

I'm concerned with the practices on my team regarding following REST and HTTP verbs precisely. For example, when we hit a get endpoint for a resource/resources that doesn't exist, we return a 404. ...
Ben R's user avatar
  • 11
0 votes
2 answers
1k views

How can I do a GET for complex calculation when the amount of data required may be too large for a GET?

We have an internal library that does a calculation based on several datapoints. There is a fair bit of data required for the calculation, about 5kB in total. I'd like to make this an API endpoint for ...
jcollum's user avatar
  • 229
1 vote
1 answer
1k views

How does resuming downloads work?

I have seen download managers manage to resume HTTP downloads from where they stopped. How are they able to resume downloads? Is it related to the Accept-Range Header? Or are there other mechanisms ...
Vipin Menon's user avatar
-1 votes
2 answers
191 views

What are the benefits of HTTP statuses compared to custom JSON based protocol?

I am currently developing a service and a client and I use HTTP statuses for communicating certain info. For example, I have a POST /vikings endpoint that starts a long running process to create a ...
Anton Daneyko's user avatar
1 vote
2 answers
211 views

REST HTTP Response code for a resource that the user is not authorised to access

Suppose user A creates a private resource at, for example, /books/somebooktitle If user B attempts to access the resource at /books/somebooktitle what code should be returned? HTTP403: Permission ...
Neil's user avatar
  • 229
3 votes
3 answers
448 views

Is a good practice reuse HTTP codes to encode something else?

As we know HTTP codes are used in HTTP response. Usually with this code we can have an idea about what happened. For example if I make a get request and I obtain a 404 I can figure out that the ...
SGiux's user avatar
  • 191
1 vote
3 answers
581 views

Is the "archetype controller" really complies with REST architectural style

I've read the Fielding's thesis that defines the REST architectural style and noticed that the defined style appears to significantly conflicts with the so called "archetype controller", ...
Danilo Mendes's user avatar
1 vote
1 answer
196 views

How to implement UTM tracking correctly?

A GET should never change data on the server- use a POST request for that I heard this recommendation countless times over the internet and always try my best to conform. But how should I implement ...
Elgin Cahangirov's user avatar
-1 votes
3 answers
146 views

What is the correct status code when serving different content than requested?

I'm working on a website that has different languages, being English the master language. Most of the site is fully translated but English content has a bigger team so it usually goes a bit ahead of ...
JCalcines's user avatar
  • 151
1 vote
1 answer
310 views

Advantages and disadvantages of including JS/CSS inside the HTML?

What are the advantages and disadvantages of including JS/CSS inside the HTML instead of separated files? Specifically concerned about performance issues, for example, if the CSS and JS are small and ...
MauricioRobayo's user avatar
1 vote
1 answer
499 views

What is the correct architecture for communication between an HTTP server and a WS server on the same machine running in separate processes?

I have a Node.js HTTP REST API server and a Node.js WS server. I separated them into 2 entrypoints so that they can be more easily debugged and run separated from each other, but now I need the REST ...
silviubogan's user avatar
0 votes
1 answer
336 views

How to properly notify a client from the server side in Golang (broadcasting)?

I'm working on a project which focuses on simple HTTP-related actions (to get my feet wet really). I'm using the net/http package, which I thought was very convenient for almost all requirements ...
Chien's user avatar
  • 129
0 votes
1 answer
300 views

How to design a rest api for updating collection(ArrayList) of Resource in Spring boot?

I have a resource called Client and it has the following attributes id, name, redirect URLs(ArrayList). class Client{ int id; String name; List<String> redirectUrls; } I have all CRUD ...
Vijay Kambala's user avatar
0 votes
0 answers
104 views

Websockets or HTTP | B2B environment

Let's start off with the infrastructure architecture that we have, because that's the most important aspect of this conversation. Clients (browsers) which communicate with the product cluster (over ...
charen's user avatar
  • 101
-4 votes
2 answers
135 views

Does the HTTP specification fully define the semantics of request methods?

I see two possible interpretations of the semantics of request methods defined in the HTTP specification RFC 7231: The intended effect of a request method is fully defined by the HTTP specification (...
Géry Ogam's user avatar
0 votes
2 answers
231 views

A command as the intended effect of POST versus as the side effect of PUT

The intended effect (semantics) of the POST method is resource specific, e.g. executing a command with arguments: POST /command HTTP/1.1 {"parameter-1": "argument-1", "...
Géry Ogam's user avatar
1 vote
1 answer
351 views

Asynchronous HTTP request pattern

Here is the pattern that I thought about for a resource accepting a single asynchronous HTTP request at a time (i.e. a request which has not yet been fulfilled when the response is sent): Create a ...
Géry Ogam's user avatar
3 votes
3 answers
341 views

Can REST resources represent behaviour?

In the red book by V. Vernon it says about REST: In RESTful HTTP, the methods are the HTTP verbs - most importantly, GET, PUT, POST, DELETE - that can be applied to resources. Even though it might ...
Hans's user avatar
  • 416
2 votes
2 answers
617 views

Roy Fielding’s REST alternative to HTTP cookies

I struggle to understand Roy Fielding’s REST alternative to HTTP cookies, § 6.3.4.2 ‘Cookies’ and § 6.5.4.1 ‘Application State in a Network-Based System’ of his doctoral dissertation Architectural ...
Géry Ogam's user avatar
2 votes
2 answers
1k views

Long polling and message brokers

I was reading this article, and the author uses HTTP long polling to design a chat application. I was wondering how does this compare with a dedicated Message Broker services like Apache Kafka, or ...
Ufder's user avatar
  • 244

1
2 3 4 5
8