REST, HTTP DELETE and parameters

No, it is not RESTful. The only reason why you should be putting a verb (force_delete) into the URI is if you would need to overload GET/POST methods in an environment where PUT/DELETE methods are not available. Judging from your use of the DELETE method, this is not the case. HTTP error code 409/Conflict should … Read more

What exactly is an HTTP Entity?

An HTTP entity is the majority of an HTTP request or response, consisting of some of the headers and the body, if present. It seems to be the entire request or response without the request or status line (although only certain header fields are considered part of the entity). To illustrate; here’s a request: POST … Read more

Custom HTTP Authorization Header

The format defined in RFC2617 is credentials = auth-scheme #auth-param. So, in agreeing with fumanchu, I think the corrected authorization scheme would look like Authorization: FIRE-TOKEN apikey=”0PN5J17HBGZHT7JJ3X82″, hash=”frJIUN8DYpKDtOLCwo//yllqDzg=” Where FIRE-TOKEN is the scheme and the two key-value pairs are the auth parameters. Though I believe the quotes are optional (from Apendix B of p7-auth-19)… auth-param … Read more

Setting HTTP headers

Never mind, I figured it out – I used the Set() method on Header() (doh!) My handler looks like this now: func saveHandler(w http.ResponseWriter, r *http.Request) { // allow cross domain AJAX requests w.Header().Set(“Access-Control-Allow-Origin”, “*”) } Maybe this will help someone as caffeine deprived as myself sometime 🙂