HyperText Transfer Protocol

learn more… | top users | synonyms

0
votes
0answers
19 views

Design pattern for socket.io and Express

I have a Node.js Express RESTful HTTP server I will call server A and an Express socket.io server I will call server B. Server A responds to all HTTP requests by clients and server B listens to the ...
-1
votes
0answers
18 views

Segmented file downloading potential gains vs excess overhead/problems

I'm writing a download manager, i want to get as much speed as i can from my downloads and I'm thinking about implementing segmented file downloading with conjunction to parallel download for each ...
5
votes
8answers
527 views

Is it okay to return the “wrong” HTTP status code in order to show a more user-friendly error page?

Located here, RFC 7231 is all about the HTTP protocol (status codes) I'm developing an in-house web application for my university's department and I'm at a (probably unimportant) impasse. I'm ...
-1
votes
1answer
45 views

Sending Form Data and Image? [closed]

What is the way to send form data and image(s) to an http-server ? Should I go with Multipart/Form-Data or add the image content as a value to the json data with some key ? What are the ...
7
votes
0answers
138 views

Is progressive HTTP download a viable alternative to HLS/DASH/RTMP for providing live video?

I'm working on a website that needs to stream live video to users, and as such I've had to get my head around the sorry state of current browser-based video-streaming technology. The most popular ...
2
votes
3answers
124 views

Recommended HTTP status code for “plan limit exceeded” response

I'm designing a REST API for a project where users are always on one of several "plans" - each plan defines some resource limits, such as the max number of users an account may have or the max number ...
0
votes
1answer
53 views

REST API - Updating a Variable

If you are updating a variable in a RESTful API, for example person's weight, how should this be laid out? What I have thought of: PUT /person/1/weight?weight=150 PUT /person/1/weight {"weight": ...
0
votes
1answer
81 views

What is the middleware (if any) in web-service consumed by a website?

I am trying to identify the parts of an architecture. The server (Python) acts as a web-service, delivering files and data. The client (JS) requests the data which it needs by sending xmlhttprequests ...
0
votes
1answer
134 views

Alternatives to Request For Comments

I personally find RFC's quite difficult to read. They tend to be quite long, not precise enough, really old and for the most part, quite difficult to convert into actual working code. I think the ...
2
votes
3answers
97 views

Appropriate use case for “accepted”?

We have a task enqueued by a REST endpoint that will create a resource and then enqueue a task either immediately or delayed based on some business logic. I was thinking of using HTTP/1.1 200 OK for ...
1
vote
2answers
65 views

ID's in resource URLs: database id or per-user id?

For REST interfaces or webapps with nice-looking URLs, I constantly ask myself on what numbers to use if we want to refer to specific resources/pages. A typical approach seems to be to use the unique ...
4
votes
1answer
119 views

Why does SOP permit cross-origin form submissions?

Same Origin Policy does not prevent origin foo.bar from creating a form with action attribute set to another origin baz.duh and even allows to programmatically submit this form without the user ...
2
votes
1answer
80 views

HTTP API Versioning and Need to Introduce Breaking Changes to All Supported Versions

I am developing an HTTP application and deploying this by versioning it against the semantic versioning patterns/techniques/whatever they are. In order not to break existing clients and allow the ...
-2
votes
1answer
146 views

Crawler - programming language choice [closed]

I'm currently developing a web crawler. The first version was developed in Node.js and runs pretty well. The issues that I encountered with Node.js are in no particular order: slow URL and ...
-1
votes
2answers
108 views

In C is it possible to change http requests to https [closed]

Long story short I've got this package that currently has a security risk where credentials are sent over http and I need to convert them to https but I currently lack the knowledge to do so. Could ...
1
vote
1answer
86 views

How to avoid server-pushing assets to clients that already have them cached?

HTTP/2 server push enables pushing assets to clients which you anticipate they'll need in order to render the page. For example, you can push your CSS/JS/images to the client at the same time as you ...
0
votes
2answers
48 views

Android. HTTP Communcation, and GCM

I have an app that sends/receive data via HTTP POST, and communicates with PHP/SQL on the backend. I however wanted to integrate GCM to I can tell the app to "check for an update" to query the ...
1
vote
1answer
111 views

How does StackExchange load data from the server without making an XHR request?

When viewing the questions for a tag on SE networks, every now and then you will get a message at the top: n questions with new activity. However the weird thing (to me) is that I don't see any ...
3
votes
1answer
206 views

What belongs in an HTTP request header vs the request body?

I'm working on a set of web services for a mobile client, and the requirements call for a unique device id to be included with all requests, to be stored in certain requests, and used to filter ...
14
votes
6answers
1k views

What to call an HTTP API that is not RESTful? [closed]

What would you call an API that is HTTP-based, uses URI to name resources and HTTP verbs (PUT, POST, DELETE, GET...) to manipulate those resources? According to Roy Fielding's complaints it is not ...
0
votes
1answer
196 views

Detect request coming from iframe

I just had this awesome idea about simulating a single page application using iframes. I am using a framework that uses layouts to display pages. Luckily I can use an empty layout (meaning it has no ...
3
votes
2answers
69 views

Does sending system-profile information with HTTP GET request conform to RESTful practices?

I'm using the Sparkle framework to update an app, and want to make use of the framework's ability to send system-profile information. The way this is done is by adding the information to the HTTP GET ...
0
votes
2answers
88 views

comparison of computer processing language vs protocol

how can explain the diference between programming languge and protocol?, can protocol have extension? we know that machines communicate with protocol, but they can also do so with expressive ...
0
votes
2answers
129 views

Content delivery design

I'm designing a system where users can access files stored in an external content storage service such as AWS's S3. Here's a simple diagram: ------ ------------ ----------------- | User ...
1
vote
1answer
259 views

Should I store my user claims in the JWT token?

I am using JWT tokens in HTTP headers to authenticate requests to a resource server. The resource server and auth server are two separate worker roles on Azure. I cannot makeup my mind as to whether ...
1
vote
2answers
625 views

How should I provide detailed information about an error, if not through HTTP status codes?

This question comes from here. I believe it deserves to be on its own instead of being lost in a long question with multiple points. I'm building an API and find myself limited by HTTP error ...
1
vote
2answers
97 views

Should I specify the userId in the REST URL structure?

Basically, one feature of my app is to retrieve the logged user's friends. Actually, I hesitate between both kind of endpoints: GET /api/users/friends GET /api/users/:userId/friends Using 1, ...
0
votes
1answer
230 views

HTTP keep alive and TCP persistent connection

What's the relationship between the two concepts? Is one HTTP Keep-Alive connection always over a long persistent TCP connection? When the HTTP connection is closed, will the TCP connection be closed ...
1
vote
2answers
48 views

HTTP status code for mobile clients

There was a debate with one of the platform engineers (as a mobile dev), about the codes being returned. The scenario is: when trying to create a resource the server is returning a 201 with the ...
0
votes
0answers
177 views

Reason why client-side JavaScript does not allow access to POST/PUT/etc contents

Is there any theoretical reason why client-side JavaScript could not be spec'd to allow for direct access to POST or PUT contents without need for a server language to write it into client-side ...
1
vote
2answers
107 views

Do web applications use HTTP as a transport layer, or do they count as an integral part of the HTTP server?

Given an HTTP server (e.g. Apache, IIS) and a web application (user code running in the server using PHP, ASP.NET and the likes), which of those can decide which HTTP status code to return for any ...
1
vote
1answer
3k views

Two way Communication between Server and Clients

Situation: We have a web application running on a server. This application needs to fetch data from some other PC(Clients), which are on a different network. On the clients' pc there are WCF hosted ...
2
votes
1answer
72 views

Request content-type of HTTP errors

HTTP allows for multiple representations of a resource. The Accept header allows the client to choose the representation of the resource. GET /foo/bar HTTP/1.1 Accept: application/pdf GET /foo/bar ...
3
votes
2answers
322 views

RESTful key-value collection

I am creating a HTTP REST API. I have a large collection of key-value pairs, at /base-url. I need to provide the ability to get and set values for a key. My first attempt: GET /base-url/{key} PUT ...
2
votes
0answers
59 views

Response Header for illegal file (format)

I have a simple upload-servlet and need to report if a file is illegal and has not been added. For some reason i am not allowed to give a html-body back, so i need to use the response-header. ...
3
votes
1answer
464 views

Rendering head :ok vs head :no_content. Any good practices?

Whenever I take in data and do something like delete a post, etc. I generally return head :no_content. For example: def destroy @post = Post.find_by(external_id: params[:post_id]) @post.destroy! ...
-2
votes
2answers
123 views

Where is it implied that REST is not based on HTTP [closed]

I've been over Fielding's paper on REST and all over the web, including StackOverflow trying to understand this. After reading everything I can about REST, I was under the impression that Fielding ...
7
votes
1answer
883 views

Why PATCH method is not idempotent?

I was wondering about this. Suppose I have a user resource with id and name fields. If I want to update a field I could just do a PATCH request to the resource like this PATCH /users/42 {"name": ...
1
vote
1answer
342 views

Should I hide certain HTTP status codes?

So I have different seniors taking different positions on this. Some saying hide nothing, those codes are there for a reason. Others saying to hide most status codes, reducing the number to a much ...
1
vote
1answer
884 views

How to respond with error message when making AJAX calls

I have an app that wasn't written by myself. If there is an error such as an invalid ID given as a parameter, I would return something like: (200 code) { "success": 0, "error": "The row ...
16
votes
4answers
537 views

Providing friendly URLs for a website vs. realities of database IDs

We have a database of resources, be they products, blog posts or something. We need to design a URL scheme to address them, for the public website. Here are two examples that are database ID bound: ...
6
votes
3answers
512 views

Proper Response to HTTP Request When Too Much Data is Requested

I'm building an API for an ad serving platform that will allow you to request tracker data for ad campaigns. Campaigns often exceed hundreds of millions of requests, which means there will be many ...
16
votes
4answers
4k views

Why can't we use IP address instead of cookies in identifying the client in servlets?

I know we have some extra advantages in using the cookies over IP address, but my question is Why can't the container just remember the IP address of the client in identifying the client when he visit ...
7
votes
4answers
1k views

Is it a good idea to merge multiple HTTP requests to save bandwidth?

I am preparing a single page application that would be sometimes used over slow mobile connection. Some of its part are quite heavy in terms of API requests (fetching ten different resources for a new ...
1
vote
2answers
139 views

Should all HTTP requests including credentials be made using a POST even if it is actually just a request for data?

Assume there is a request which is going to look up a list of items from a service which requires authorisation (e.g. it's behind a Basic Authentication domain). If the service didn't require ...
0
votes
1answer
177 views

How to communicate side effects in a RESTful API on the server to the client?

I have been thinking a lot about Hypermedia REST-APIs for the last couple of weeks. One thing I am not quite sure about is how I want to model side effects on the server side. In my current project, ...
5
votes
3answers
755 views

How to handle business rules with a REST API?

I have a REST API to manage a booking system I'm searching how to manage this situation : A customer can book a time slot : A TimeSlot resource is created and linked to a Person resource. In order to ...
2
votes
5answers
328 views

Why doesn't the HTML\DOM specification allow hyperlinks to set an accept header?

The purpose of the Accept header from the client is to tell the server what kind of data it will accept as a response to its request. We can set this header in asynchronous HTTP calls in Javascript, ...
1
vote
1answer
182 views

URLs with variable query strings and cache

I am developing a media server, the basic functionality is to serve an image, which is done the following way /media/:id where :id is the id of the image. You may want to ask for a specific size, ...
0
votes
0answers
66 views

How does session middleware generally verify browser sessions?

I've been using session middleware to build web apps for years: from PHP's built-in session handling layer to node's connect session middleware. However, I've never tried (or needed) to roll my own ...