Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [http]

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

10
votes
5answers
2k views

What should I do when optimistic locking doesn't work?

I have this following scenario: A user makes a GET request to /projects/1 and receives an ETag. The user makes a PUT request to /projects/1 with the ETag from step #1. The user makes another PUT ...
0
votes
0answers
64 views
+200

How to handle “Optimistic Locking” on a collection with ETag headers?

Consider endpoint /projects that returns a list of projects with the following headers: HTTP/1.1 200 OK Etag: "superEtag" The etag value represents a hash of the entire collection and it does not ...
4
votes
2answers
169 views

HTTP response header to indicate request was forwarded to another server by reverse proxy

Given a system of services and a reverse proxy, such that requests may either be conclusively processed by the proxy or ultimately handled by any of the services behind the proxy. Consideration has ...
6
votes
3answers
401 views

What reasons are there AGAINST using only POST HTTP verb in an API?

I am researching before starting to work on an API for a web-service I am building. The goal is to be very quick and easy to adapt and use for other developers but fairly hidden for clients using a ...
2
votes
2answers
166 views

How to integration test server failures (http 500)

Like in the title: how do you integration-test server failures that return 500 HTTP responses? For example: There's a server with a /save endpoint that accepts files on POST and saves it into the ...
0
votes
1answer
171 views

Why not put TLS certificate in DNS responses?

The security of a TLS connection relies on trusting the CA's certificate, which in turn, is usually actually a proof of DNS entry ownership. Even though the server operator may request a certificate ...
0
votes
1answer
101 views

Professionalism of implementing the HTTP “QUERY” method in an API

Some years ago, the w3c documented a proposal for a method called QUERY, where query information may be passed in as the request body rather than on the request line in query parameters. You can see ...
0
votes
1answer
33 views

How to route/implement port forwarding with AWS/Apache web server (httpd) with a Node.JS app on port 3000?

I'm trying to understand this and having a hard time. I usually use Ubuntu server, with Apache2, and this time I am not. So I'm a bit out of my element. I'm also a software developer and I don't do ...
3
votes
2answers
71 views

HTTP Methods - what about only using POST for Ajax calls?

You can find whole articles theorizing when you should use what METHOD in what edge case. It mostly comes down to this; every action needs to be simplified to in just four flavours (GET, POST, PUT, ...
-3
votes
1answer
31 views

Disable recieving messages from queue remotly

I have a CRUD like service which have REST HTTP API. This service have two instances - only one recieving request at time. If first instance starts throwing exceptions or slowing down we change load ...
3
votes
2answers
114 views

Proper URL structure in REST API to change status of one particular record

What's the proper URL structure in REST API for changing state of one particular record (e.g. change from "new" to "processed"). Now I work with this URL without request body: PATCH /employees/123/...
1
vote
2answers
166 views

What happen if we never dispose HttpClient, .Net C#?

I'm working on a windows service. Code of windows service is very simple but it has a strange manner! In windows service I should call a WebApi each 20 seconds and save the result in a SQL Database I'...
48
votes
10answers
9k views

What should be the http status code for “Service not available in your area” error?

Our service is in 5 cities right now. If someone tries to call our service API from any other city, we want to throw this error Service not available in your area. The question is, what is the ...
1
vote
1answer
66 views

Design: HTTP and Websockets working together

I'm at a bit of crossroads here and I wanted to ask the opinion of the community. I am creating a chat application for our company. Now, like every chat application out there, the messages are saved ...
0
votes
0answers
32 views

Data exchange between Chromium and a game client

I am creating a lightweight UI web app that will be embedded into a game client (PC) via chromium. This web app will be able to do a few simple actions and will communicate with an external REST API ...
1
vote
2answers
72 views

How much to log with 400 or 500 HTTP resonses?

In light of the recent Twitter logging bug, I've been thinking about something with my own web-app: how much information should I log in the event of a 400 or 500? I obviously don't want to be logging ...
0
votes
0answers
138 views

What kind of information I should pass through a HTTP Header?

I was trying to find if there is some kind of reference about what type of informations are important to be passed on the HTTP Header. I understand that some information seems natural to be there, ...
2
votes
5answers
658 views

API “initialize” method: POST or GET?

We faced an issue with an API "init" method, and trying to understand if we must use GET or POST http method in context of REST. Preconditions: SPA on the frontend which communicates with our backend ...
1
vote
0answers
299 views

Are AJAX calls fully replaceable by requests sent via WebSockets?

I am redeveloping an application with the aim of going along with the more modern techniques. That is how I came across Socket.io, which I integrated with express.js. I implemented live searching ...
0
votes
1answer
105 views

Is a URC (Uniform Resource Citation) synonymous with a Query String or Url Parameters?

Reading this: https://renenyffenegger.ch/notes/development/web/URI-URL-URN-IRI-URC URCs provide a set of attribute/value pairs that describe properties of URIs like authorship, publisher, ...
0
votes
1answer
180 views

Web page accessing local system via localhost HTTP API

I have seen this pattern that allows web pages to interact with local system resources through a HTTP interface and I have a couple questions about it: What is this pattern called? What ...
1
vote
1answer
119 views

Rest API for supporting dual listbox

I'm trying to figure out what my API route and HTTP method should be for supporting a dual list box (e.g. http://geodan.github.io/duallistbox/sample-100.html) Say, I have a collection, GET /employees ...
0
votes
0answers
318 views

Design of api for spa applications

I have application for configuring e-commerce website (for example routing, page alliases, ordering, etc.). In old old times in server rendered applications I would have api like: POST/api/things/1/...
1
vote
0answers
118 views

CORS headers for non-200 HTTP responses

I'm specifying an API for a REST service. The REST service will be primarily accessed by web browsers using XHR requests running code hosted from remote origins. Therefore, I'll need to add CORS ...
0
votes
1answer
144 views

HTTP response code for proxy with expired connection resource

I am building a service which acts as a proxy to third party data providers for the end-user. My service uses tokens for authorization and if the user does not have a valid token it responds with 401 ...
7
votes
2answers
753 views

Can a caller abort an execution of code invoked by HTTP request?

A third party that is going to make HTTP requests to the API that I'm building, requires that the API responds in less than one second. My question is, do they have a way (literally any way, within ...
2
votes
1answer
148 views

Software architecture of IoT hardware controller program with embedded HTTP server

Just trying to design an architecture/class relations for my current C++ project in the IoT field. The program itself (controller) controls various hardware via an arm-based device. I intend to use ...
2
votes
1answer
329 views

Not prohibited, but disallowed — which http error code should I return?

I know that if user is forbidden in an admin's area, I should return 401 or 403 status error code. However, what I want to prohibit an admin for accessing a user's dashboard also? An admin has its own ...
0
votes
1answer
163 views

is the term “payload” is used exclusively in request?

Is the term "payload" used exclusively for the payload of (let's say http) request or it may be used to describe the useful information in the response of a request? If its used for both payloads (...
-2
votes
3answers
188 views

Is authentication equally important to encryption?

I am thinking how to implement the login of a new web application and as I search the net, most search result as about authentication instead of encryption. Assumption: The web application is ...
0
votes
1answer
213 views

Replacing HTTP with plain TCP in a client-server application

I'm building a small application composed of: Client (command-line) Business logic (remote server) It's a simple game of tick-tack-toe where the client sends information to the server about which ...
3
votes
1answer
70 views

Should a push hold data or make the receiver trigger an API call?

With WebSockets, when clients should be notified that data changed, I've seen two approaches: the server pushes the data modifications directly within the push; or the server pushes no data, and the ...
-4
votes
4answers
343 views

Is get and post interchangeable?

I know that there are some differences between GET and POST, like descriped in this post on StackOverflow. But what I cannot figure out is, are they interchangable, assuming that you change your code ...
1
vote
1answer
187 views

Split requests between different server applications

I currently have a web server running apache with multiple sites on it using virtual hosts. I want to add a service to my server that is using nodejs but I want it to be accessible under the same ...
0
votes
1answer
58 views

Disambiguating errors for the same HTTP status code

Assume I have two different error cases that logically have the same HTTP status code. What's the canonical way of providing data dependent on the error case in the response so that clients can ...
15
votes
6answers
2k views

REST endpoint to show a preview before POSTing

I'm designing a new web application which is powered by a REST backend and HTML+JS frontend. There's one POST method on it to change one entity (let's call Config), that has several side effects in ...
4
votes
3answers
566 views

Why do RESTful services that implement HATEOAS provide a self-relationship link?

I'm learning about HATEOAS and I noticed that every implementation always seems to implement a self-relationship first. For example a common response object might look like { title: "The Wonderful ...
4
votes
2answers
142 views

Are there worthwhile advantages to creating a separate docker container to handle http?

I've got a Python webapp running in docker container and a DB container/service, and I'm wondering if the apache/mod_wsgi functionality should be contained within the container that runs the python ...
1
vote
1answer
740 views

Spring4 error handling and HTTP status codes returned for REST services

We are writing Spring4 based REST services and had a question about returned HTTP status codes. It looks like the generally accepted approach is to let the app server or web server container handle ...
0
votes
1answer
485 views

Implement a HTTP server on top of NodeJS TCP APIs for learning purposes

I am very interested to learn the HTTP protocol in depth as well as understand the working of NodeJS streams up-close. I figured out that the best way to do this would be to develop an HTTP server in ...
0
votes
2answers
69 views

Making an HTTP request for a response without a layout

I'm making an application where the front-end can display resources both as themselves or within a modal. Of course, when the server gets a request for a resource in HTML, it's going to include a ...
2
votes
2answers
206 views

Is there a standard language for defining HTTP APIs?

For example, facebook and google have a lot of APIs, like getting data and doing actions on behalf of a user (backup files to Google Drive). I can read all of their documentation but I usually like ...
2
votes
0answers
486 views

Long lived connections

I have a custom non-blocking I/O server that supports (among other things) HTTP and websockets. I have two timeout concepts for connections: idle: connections that don't do anything are closed after ...
5
votes
3answers
1k views

How to decide the granularity for RESTful APIs

Most of us know SOLID, and over the years have understood how useful it can get when we need to change. Based on S & I parts of SOLID and from experience I used to design my HTTP RESTful services ...
3
votes
2answers
872 views

REST Web API: What should be returned? NotImplemented, BadRequest or Bad Design?

Let's say I have an enumeration of related information types and an enumeration of time periods. Also I have created two operations on a controller for retrieving data of those info types. Due to ...
-3
votes
1answer
645 views

What is the diffence between HTTPListener and a webservice

Im using C# as my development language. However I have some confusion over HTTPListener and a web service. Can you please explain what are the differences and advantages and possibly a situation in ...
5
votes
1answer
2k views

REST API caching strategy for collection of records

I am designing a REST API for my mobile clients to interact with our app server (built with Django/django-rest-framework if it makes any difference). There are a number of different objects ...
1
vote
2answers
533 views

Microservices, browsers and HTTP requests

In the old days we used to create a single .gif file for the entire application to avoid too many trips from the browser to the server. Similarly, we used to combine different types of information in ...
4
votes
2answers
2k views

REST: How to determine transient exceptions?

As I try to deal with the possibility of failure when I invoke RESTful endpoints or in general any HTTP endpoint I've been wondering if there is any standard or pattern in the HTTP specification or in ...
7
votes
1answer
181 views

What is (full) semantic transparency?

I was reading the RFC 2616 regarding HTTP/1.1 when this term came up: Therefore, the HTTP/1.1 protocol provides these important elements: [...] Protocol features that provide full semantic ...