Record http form posts via a browser

For a simple interaction, you don’t really need a tool like Selenium that will record and playback requests. You only need the tools you’ve already mentioned: Chrome already comes with the Developer Tools that you need: use the Network tab. No plugin to download. I don’t know if Safari will work — I don’t see … Read more

Are character set names case-sensitive in HTTP?

[Here is the result of my research.] RFC 2616 clause 3.4 says the following: HTTP character sets are identified by case-insensitive tokens. The complete set of tokens is defined by the IANA Character Set registry [19]. charset = token The IANA Character Set registry is now maintained here. At the very top of this document … Read more

How can you delete a cookie in an HTTP response?

Just set the cookie on exactly the same name, path and domain, but with an Expires value in the past. Optionally, set the value to null/empty-string, even if it’s just to save the bandwidth, it’s otherwise ignored anyway by the average client. Note that setting on exactly the same path is important. Many starters fail … Read more

Appropriate HTTP status code for request specifying invalid Content-Encoding header?

As i’m reading it, 415 Unsupported Media Type sounds like the most appropriate. From RFC 2616: 10.4.16 415 Unsupported Media Type The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method. Yeah, the text part says “media … Read more

How to check whether user has internet connection or not in Angular2?

(2018) Code updated for rxjs6 It totally works with angular2. Obviously it’s different from angularJS because neither $scope nor $apply exist anymore. RxJS makes this easy, though! Tested on Chrome 53: template: <p>{{online$ | async}}</p> component: import { Observable, fromEvent, merge, of } from ‘rxjs’; import { mapTo } from ‘rxjs/operators’; @Component({ /* … */ … Read more

Which HTTP methods require a body?

EDIT: compiled list: an entity-body is only present when a message-body is present (section 7.2) the presence of a message-body is signaled by the inclusion of a Content-Length or Transfer-Encoding header (section 4.3) a message-body must not be included when the specification of the request method does not allow sending an entity-body (section 4.3) an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)