HyperText Transfer Protocol

learn more… | top users | synonyms

1
vote
2answers
98 views

Is it safe to say that AJAX is a particular way of using HTTP?

I really need someone to confirm the following, and if necessary help me filter what I have read so far. AJAX, which stands for Asynchronous JavaScript and XML, is used to exchange data and is a ...
0
votes
1answer
41 views

REST API with optional resource creation

I have a web app with JavaScript front-end which communicates with back-end via REST API (AJAX calls). Front-end have a Sign Up page. When user decides to register, front-end makes REST call to ...
0
votes
1answer
105 views

Is it possible to download a section of a HTML file programmatically?

Can one define a section of an HTML webpage to download (typically using HTTP), instead of the whole file, and utilize this in a program to save bandwidth? For example, in C# (but I guess the language ...
1
vote
2answers
93 views

What API design makes the most sense for changing a user's password?

Consider a web page where a user changes his password after clicking on an emailed password reset link. The page will be implemented against an API using ajax, rather than as an ordinary form ...
-1
votes
1answer
71 views

How to send a http request through a program developed in C? [closed]

As you read in the title, for example, i wanna login to my account in StackOverflow by sending the E-mail and password through a program developed in c language, so all what i have to do is to enter ...
0
votes
1answer
42 views

How to deal with automatic binding exceptions with Jersey?

It's really nice to have automatic binding with Jersey-Jackson (well, I believe it's actually MOXy the one who manages the bindings), so object serialization and deserialization is done under the hood....
2
votes
2answers
161 views

Should I return a 204 or a 404 response when a resource is not found?

I am developing a simple RESTful service for tournaments and schedules. When a tournament is created through a POST request containing a JSON body, the tournament is inserted in a BiMap, declared as ...
-1
votes
1answer
113 views

What are the benefits of Asynchronous HTTP

Q.1 I know that when we are talking about synchronous HTTP, for each request a Thread may be spawn and get blocked, so when number of simultaneous connections increase, we will encounter massive ...
5
votes
2answers
113 views

REST server user authentication

So i am creating my first larger scale application (by larger scale i mean something i see myself publishing in the app store) and i am not sure of how to handle user authorization. The client will ...
2
votes
2answers
110 views

Is it correct to use PUT with multipart content?

We are using Spring and want to implement a REST with a "override file" call so we think using PUT verb with a multipart body only to find that Spring don't accept it. My question is it can't be done ...
0
votes
2answers
100 views

Best Communication strategy for monitoring dashboard

I have a requirement where I need to display certain stats on Admin Dashboard in my web application (Angular+Java). These stats (transnational data) are being generated on different servers (connected ...
5
votes
1answer
134 views

REST API - What HTTP code should be returned when resource is not in a state required to complete the operation?

Our API accepts PUT requests in order to change status of resources. Think of this as a state machine. Client can specify the target state of the resource via PUT request but it is possible that the ...
14
votes
3answers
648 views

HTTP Status Code for “Still Processing”

I'm building a RESTful API that supports queuing long-running tasks for eventual handling. The typical workflow for this API would be: User fills in form Client posts data to API API returns 202 ...
11
votes
3answers
488 views

RESTful API. Should I be returning the object that was created / updated?

I'm designing a RESTful web service using WebApi and was wondering what HTTP responses and response bodies to return when updating / creating objects. For example I can use the POST method to send ...
0
votes
0answers
56 views

Publish / Subscribe via HTTP Callbacks?

My team is tasked with creating a publish/subscribe system for incoming REST messages. 99% of the time, this system will be used for notifications between different processes on the same cpu, but we ...
0
votes
1answer
43 views

What is the importance of WS-Addressing in SOAP?

I'm learning Web Services Addressing and SOAP, but I can't get the importance of WS-Addressing in SOAP. This is quoted from Wikipedia "standardized way of including message routing data within SOAP ...
2
votes
1answer
75 views

Is it acceptable for user agents to modify cookies other than by instruction from the server?

Using javascript or in a native iOS App it is possible to read and modify cookies. The server generally sets these, but if both the server and the client modifies the values then it becomes a global ...
0
votes
2answers
36 views

Secure authentication using JWT

I read about JWT and how they can provide secure authentication for calling api routes over http. I naively implemented it and here is how it goes : a client posts username and password to a login ...
3
votes
2answers
182 views

How are POST/PUT/DELETE data passed to APIs?

I know that the data is passed through HTTP, but I'm not sure if I should be passing data through HTTP headers, or HTTP bodies. Which one is the convention for APIs? Also, theoretically using PHP, ...
7
votes
3answers
537 views

Microservices and isolated data storage models [duplicate]

I have been looking at Microservices for a while now. The concept is not new but it's communicated in a lightweight manner. So, I am very excited about this. However, there is a question that I am ...
27
votes
3answers
1k views

Should I use HTTP status codes to describe application level events

Several servers I have dealt with will return HTTP 200 for requests that the client ought to consider a failure, with something like 'success : false' in the body. This does not seem like a proper ...
0
votes
1answer
122 views

What encoding are the HTTP status and header lines?

If I was going to write a parser for HTTP, would I be able to assume the encoding of the HTTP headers and status line? Until I read the charset or encoding header, how could I tell what the encoding ...
0
votes
2answers
113 views

Should my public webservices use HTTP or HTTPS?

The situation is a bit more complex than the title suggests (but not much). I'm working on a REST API that will have a few open / publicly available resources and a few with authentication. (The ...
2
votes
1answer
179 views

Load testing HTTP server with large number of concurrent connections

I'm trying to load test/benchmark a http server with a very large number of simultaneous connections (10-100k). What is a good procedure for doing this? On linux I've seen that both the client and ...
0
votes
1answer
51 views

Where should I log in the user based on http session: service or controller?

I know that best practice is to let everything about authentication/authorization to the service layer. Controller should not be aware of that. But how to let a service (from service layer so) to ...
1
vote
1answer
68 views

What mechanism/protocol transmits non-HTML files when downloaded from the web?

When a non-HTML file such as a PDF, DOCX, EXE, etc is made public to the WWW by an HTTP server, and a client makes a request for said file, www.example.com/download?=test.doc what facilitates the ...
3
votes
1answer
106 views

Image resolution in a RESTful interface

Background I have a RESTful HTTP API. I have a resource. GET /my/cat HTTP/1.1 Clients may want to retrieve the image representation of this resource. GET /my/cat HTTP/1.1 Accepts: image/png ...
0
votes
3answers
153 views

Would it be possible to transfer an HTML file using a protocol different from HTTP?

I am reading about internet and stuff and just learned that web pages are really just HTML files. Also, I have learned that HTTP is just a transfer protocol. So my question is, would it be possible ...
0
votes
1answer
77 views

Should http requests be in the constructor or in a static function? [closed]

Which is conventional? For example, this is in the constructor: public class Foo { ... public Foo(...) { // http requests } ... } and this is in the static method: public class Foo ...
2
votes
1answer
154 views

Is HTTP 426 acceptable for “Your request should have been HTTPS”

I have an HTTP serving an API which works either anonymously or with a secret key in a header, like so: GET /profile?authenticationKey Authorization: 1234567890 I want to reject any request coming ...
0
votes
2answers
117 views

REST Service Description in a Hypermedia agnostic way?

How do I implement REST service description in a Content-type agnostic way? Background I am developing a RESTful API for Web Application. Now this app is somewhat different than a standard run-of-...
0
votes
0answers
114 views

Inclusive vs exclusive end for Java API for HTTP range requests

Java programmers typically expect the end index of a range to be excluded, as discussed in this question. For example string.substring(500, 1000) requests characters 500 through 999 inclusive of the ...
2
votes
2answers
121 views

How should an HTTP server respond to a GET of an absolute URI of a different server?

I'm implementing a custom HTTP 1.1 server. According to Page 35 of RFC 2616, an HTTP Request URI may take one of four forms. One of these forms is "absolute-URI", which is exactly what it sounds like. ...
1
vote
1answer
99 views

Cross application cookie access

It was my understanding that cookies are transferred with each subsequent http request, yet if I log in to a web application that uses cookie authentication, say on my browser, other applications on ...
0
votes
0answers
78 views

Spring pass-through authentication mechanism

I want to implement a "pass-through" authentication system using Java and Spring. I want to create a service that will be transferring all incoming http requests to a different host/port where ...
2
votes
0answers
308 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 ...
5
votes
8answers
644 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 ...
15
votes
1answer
598 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 ...
4
votes
1answer
123 views

How should I handle a HTTP response whose body takes time to generate, and whose headers cannot be determined until generation is complete?

Background My web application lives on a centralised server in the product's "network", and provides the means to manage/configure various distributed devices. The server also logs various statistics ...
4
votes
3answers
1k 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
73 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
278 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
145 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
154 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
241 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
133 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
113 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
558 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 query-...
-1
votes
2answers
144 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
161 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 ...