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.

-1
votes
0answers
28 views

Failure handling and response code mapping in a (HTTP/REST) service architecture in Java

TLDR: I am looking for established standards to deal with translating error codes from a downstream remote call to an error code handed out upstream at a service interface, that allows to easily know ...
-2
votes
0answers
18 views

Is it good idea to embed short-lived access token (bearor token) in HTTP header and pass it over url as qr-code string for login?

I have thought back of my mind to embed short-lived access token in HTTP header and pass it over url so that everytime when a mobile user scans the ID card (having url encoded string for example http:/...
0
votes
2answers
38 views

How do job queues return results to UI?

I am working on an app that will run queries and return results to UI. However, these queries can take a long time to finish so I should not wait for the result. As far as I know, people use task ...
1
vote
2answers
77 views

API design - indicate that results were truncated

For reasons, my search endpoint returns a maximum of 50 results. I'm struggling with how best to tell the caller that their results were limited to 50. The best I've come up with is returning some ...
0
votes
0answers
24 views

Separate server for Flask-SocketIO chat functionality?

I currently have a Flask application which acts as the backend for my website. I intend to add live private chat functionality to my website using Flask-SocketIO. I was wondering, is it better to ...
0
votes
2answers
50 views

Should I put request context in path or in headers?

I'm designing a system that will Act as proxy calling a service on a back-end in context of user and his session Manage sessions for users on multiple back-ends I will expose the system over HTTP. ...
0
votes
1answer
24 views

Optimising network data usage in vehicle tracker

I'm currently working on an Android application that broadcasts the location of the device every 5 seconds. Pseudo showing current app process: deviceLocation = getLocation() if (hasChanged(...
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 ...
1
vote
2answers
177 views

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
174 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
412 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
226 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 ...
-1
votes
1answer
178 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
43 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
72 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
119 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
229 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
69 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
34 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
78 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
176 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
807 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
324 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
113 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
190 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
121 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
338 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
124 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
223 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
1k 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
158 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
359 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
169 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
190 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
256 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
420 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
205 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
657 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
148 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
780 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
539 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
71 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
240 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
524 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 ...