HyperText Transfer Protocol

learn more… | top users | synonyms

25
votes
3answers
1k views

What does HATEOAS offer for discoverability and decoupling besides ability to change your URL structure more or less freely?

Lately I've been reading about Hypermedia as the Engine of Application State (HATEOAS), the constraint that is claimed to make a web API "truly RESTful". It boils down to basically including links ...
0
votes
0answers
65 views

Why aren't we all compromised on the internet? [migrated]

Well, I've been thinking about this for a while now. Within the last decade, we've used various ways to make our websites look dynamic and live. For example, in JavaScript, it's quite easy to send ...
0
votes
3answers
153 views

Why don't http headers include device resolution, pixel density, etc.?

I'm currently developing a responsive website with css media queries. It would be much easier if the server returned a different html/css for each viewport. I was wondering why couldn't the client ...
1
vote
2answers
132 views

Should I use HTTP search

I am working on a web api and I am curios about the HTTP SEARCH verb and how you should use it. My first approach was, well you could use it surely for a search. But asp.net WebApi doesn't support ...
3
votes
1answer
93 views

Invalid data returned, which HttpCode to return?

My web application calls a third party API. If I successfully call the API but invalid data is returned which cannot be processed by my system what is the most appropriate HttpCode to return to the ...
1
vote
2answers
99 views

How to indicate to a web server the language of a resource

I'm writing an HTTP API to a publishing server, and I want resources with representations in multiple languages. A user whose client GETs a resource which has Korean, Japanese and Trad. Chinese ...
0
votes
0answers
42 views

How to have my callbacks authenticated in a REST app?

I'm developing a REST application and I allow my clients to authenticate in several ways (typically using Authorization: Token ... as in OAuth 2.0, but also there's session-based auth option for the ...
0
votes
0answers
63 views

How can resolve an URL on a specific DNS server

I'm currently facing a issue on a project. I'm resolving URL's on multiple DNS servers using a node.js server. Until here, everything is fine. But some ISP restrict the incoming requests from IPs ...
0
votes
0answers
20 views

JSF problems due to shared server-side state

On it's latest technology radar, the guys at ThoughtWorks recommended avoiding JSF because it's attempt to create statefulness over HTTP ends up "causing a whole host of problems involving shared ...
0
votes
0answers
83 views

HTTP Session: A single object or multiple?

I tested two approaches to store session data: The classic: 1 key, 1 object (And every key as static final String in a class) "user" --> UserObject "preferences" --> List ... An ...
1
vote
2answers
190 views

What is the applicability of CORS?

I have a system which needs to do cross-origin requests and having trouble understanding the relevance of CORS. At first glance it doesn't appear to provide me with any type of security I'd actually ...
0
votes
0answers
115 views

Django web app with websockets

I want to make a web service using Django, but that also has websocket functionality. Having done a bit of reading, this is the tech stack that I'm looking at: --------------------------------- ...
-2
votes
3answers
101 views

Why speaks basic http authentication always of a username

In RFC 2617 HTTP Authentication: Basic and Digest Access Authentication they speak always of username and password for the authentication. Why should I choose to take a username as identifier for a ...
1
vote
1answer
65 views

What HTTP status codes need to be checked for this network task to perform smoothly?

My office department logs in to the ISP Server through a keep-alive-browser login page. This, for better performance, is encapsulated in to a small python script. This is what it does (Pseudo code) ...
4
votes
1answer
110 views

What HTTP verb is appropriate for an api route that restarts an application the server?

I got asked to do a code review of a very simple one-route web service that when hit would simply restart an application on the system. The developer had coded this up as a POST which strikes me as ...
3
votes
2answers
83 views

How should I specify locations where clients can resolve authorization problems in a REST API?

I'm working through an API design where a user's authentication will be verified by the presence of a valid forms authentication ticket in a session cookie. However, there are additional levels of ...
3
votes
3answers
792 views

Why REST Api do not follow the Facade design pattern

In comparing REST [api] structure with a OO model, I see these similarities: Both: Are data oriented REST = Resources OO = Objects Surround operation around data REST = surround VERBS (Get, ...
4
votes
2answers
477 views

Should I make up my own HTTP status codes? (a la Twitter 420: Enhance Your Calm)

I'm currently implementing an HTTP API, my first ever. I've been spending a lot of time looking at the Wikipedia page for HTTP status codes, because I'm determined to implement the right codes for ...
9
votes
5answers
1k views

How do web servers enforce the same-origin policy?

I'm diving deeper into developing RESTful APIs and have so far worked with a few different frameworks to achieve this. Of course I've run into the same-origin policy, and now I'm wondering how web ...
5
votes
2answers
1k views

Comparing TCP/IP applications vs HTTP applications [closed]

I'm interested in developing a large-scale user-facing website that is written in Java. As for design, I'm thinking of developing independent, modular services that can act as data providers to my ...
2
votes
1answer
262 views

PHP high traffic default page

I have a php website that will be experiencing high levels of traffic in a few weeks. We scaled the servers to accept the traffic, but want some sort of fallback page in the event that something ...
2
votes
3answers
102 views

Specifying the format in which I want to get a response through POST

It's a good practice to let a client specify the format in Web REST API: GET /api/items/123.csv However, not only GET can return some answer, but POST also can do Status: 201 Created { mgs: ...
13
votes
1answer
536 views

Why do some websites showing 0 bytes in Chrome's developer tools

I am doing a page speed optimization for my website and studying how other websites do it. I noticed that some websites such as as Facebook or Ringgitplus show 0 bytes for some of their resources in ...
2
votes
2answers
240 views

Should an Http API always return a body?

Is there some sort of standard regarding http api responses? After reading this discourse thread I started to wonder. We are developing our public http json api at my work, and we do not return ...
2
votes
2answers
931 views

Is it safe to transmit access tokens via HTTP headers?

It's the first RESTful web service and I am concerned about security issues. Is it safe to transmit my access token via HTTP headers? For example: POST /v1/i/resource HTTP/1.1 Content-Type: ...
5
votes
2answers
1k views

How should a REST API handle PUT requests to partially-modifiable resources?

Suppose a REST API, in response to a HTTP GET request, returns some additional data in a sub-object owner: { id: 'xyz', ... some other data ... owner: { name: 'Jo Bloggs', role: ...
0
votes
0answers
139 views

Talking between Web Applications and Desktop Applications

So I have been thinking of the best way to implement a native desktop app that can print from data generated via a Web App. The method I have come up with looks much like this. From the End User ...
4
votes
2answers
602 views

What can REST API do that a API using HTTP URL query strings cannot do?

I'm learning about REST and had the chance to build a basic REST API. After doing so, most of the material I read was internalized and I now have a better understanding of it. However, I do not ...
1
vote
2answers
268 views

Preventing Web Site Users From Using Their Back Button To Get To Cached Screens After Logging Out?

I have a legacy Java webapp ( Spring 3.1 MVC, legacy servlest and JSPs ) I have modified to log the user out after s/he clicks an external link to leave the web site. The last screen(s) s/he was on ...
0
votes
1answer
207 views

Rest API Architecture from Rest in Practice book

We maintain an API that as part of its purpose makes a call to an external API. This external API takes a few seconds to fulfil the request we make to it. With our current architecture the request is ...
18
votes
2answers
892 views

Levels of user permissions in a RESTful API

Let's say I have a company that ranks the cutest cats on the internet. I offer a resource at /cats/ which provides users with the latest, cutest adorable cats. Users can either get just the top 3 ...
6
votes
2answers
663 views

What does it mean to “expose” something?

So I am working on creating a Google App Engine Application, and I've come across the term "expose" a number of times, e.g. "your first app can expose objects using an HTTP based API" and "expose this ...
17
votes
8answers
2k views

When to use HTTP status code 404 in an API

I am working on a project and after arguing with people at work for about more than a hour. I decided to know what people on stack-exchange might say. We're writing an API for a system, there is a ...
0
votes
1answer
515 views

Why nginx's http parser doesnt use regular expressions?

I see the http parser written by Igor Sysoev for nginx does not use regular expressions https://github.com/joyent/http-parser What could be the main reason for such design decision? I guess I could ...
6
votes
4answers
286 views

When did the first “REST”-model and friendly URL web technology come to be?

Everyone knows that the "current" way to do things is to have user-readable URLs. Like: http://example.com/blog/edit/1234 Rather than: http://example.com/blog.php?action=edit&id=1234 When ...
0
votes
1answer
1k views

Sync SQLite using only HTTP

I currently have a SQLite DB on my server that is needed by an android app I am currently developing. I download the DB to the android device using HTTP each time the contents are changed. Does ...
1
vote
1answer
293 views

Better server to client communication mechanism over HTTP

I have a single server with several clients. I want to push messages to a particular client at a given time. Clients should not polling to the server. what are good patterns and practices to solve ...
1
vote
2answers
464 views

How to write a HTTP server?

As the title says, I would like to write a HTTP server. My question is this, how do I do this? I know this sounds VERY general and too "high level", but there is a method to my madness. An answer to ...
3
votes
1answer
453 views

The Request/Response Cycle

When User A decides he want to pay a visit to http://example.com/ it all begins with a Request. A short moment later he is given a Response. In this cycle Request-Response a lot is going on, in ...
2
votes
1answer
128 views

Websocket protocol server development

I am interested in building a custom Websocket server for college project. I have a good familiarity about HTTP 1.1 and knows quite well of how it works. I am asking this question assuming that ...
0
votes
1answer
390 views

Python web application frontend for equipment diagnostics and interaction

My goal is to have a Python application that runs a web server which hosts the user interface, and based on interactions from a user in their browser, long running tasks get kicked off and through ...
0
votes
3answers
323 views

What Http verb should the route to log out of your web app be?

Browser support issues aside, if you're being an Http/hateoas stickler what verbs should the request to log into/out of a site be? DELETE would seem like the obvious choice but I'm not sure what the ...
2
votes
0answers
123 views

Web revisioning and the Accept-Datetime header

I have been in the process of generating documentation for an upcoming project. One of the features of the data available in this project is that it will be revisioned (or at least large parts of it ...
3
votes
2answers
289 views

RESTful URI's, Creating a new noun/uri or add a queryparameter

I have a Person class with a one to many relationship to Employment. A Person in the CRM can have multiple Employments (historic data). My current REST URI for this class looks like this: ...
6
votes
2answers
1k views

Are there any problems with implementing custom HTTP methods?

We have a URL in the following format /instance/{instanceType}/{instanceId} You can call it with the standard HTTP methods: POST, GET, DELETE, PUT. However, there are a few more actions that we ...
1
vote
3answers
633 views

Is path in Set-Cookie URL encoded?

I'm writing some code that sets cookies and I'm wondering about the exact semantics of the Set-Cookie header. Imagine the following HTTP header line: Set-Cookie: name=value; Path=/%20 For with path ...
-1
votes
1answer
290 views

How to interact with C++ API through http commands?

I have a C++ API, I want to send commands through http to run any c++ method from this API. I'm using libmicrohttpd. What steps should I follow to do such a work?
1
vote
4answers
379 views

Why can't the PHP engine handle HTTP communication?

The PHP engine interprets the PHP code and is perfectly capable of working with sockets, forming HTTP packets, etc. Why then do we need a separate Apache server, when the http serving duties could be ...
3
votes
3answers
104 views

Is a predefined key enough security when performing HTTP requests between two secure servers?

I have an AdWords script that regularly transfers sensitive data to my server using a POST HTTP request. For security I have a predefined 32 character randomized string that is verified by my server ...
61
votes
5answers
4k views

Why shouldn't a GET request change data on the server?

All over the internet, I see the following advice: A GET should never change data on the server- use a POST request for that What is the basis for this idea? If I make a php service which ...