HTTP status code when single request asks for too large resource or too many of them

403 sounds like the most appropriate choice. It basically says “nu-uh. You don’t get to see that.”, which is pretty much the case here. 10.4.4 403 Forbidden The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. […] Of course, it’d be a … Read more

Proper HTTP headers for login success / fail responses?

The header that the server sends is either the 200 OK or 401 denied status codes on success or failure. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Section 10.4.2 401 Unauthorized for this. When sending the 401, the server must send a WWW-Authenticate = “WWW-Authenticate” “:” 1#challenge to indicate what scheme should be used to authenticate. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Section 14.47 … Read more

HTTP Status Code for Resource not yet available

409 Conflict The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to … Read more

Which HTTP status code to return when the DELETE operation is not allowed for particular reason

I would go with 409: Conflict, because what you have is a violation of resource state. 405: Method Not Allowed would also work. If you’d want to use a 405, you’d have to send an Allow header to indicate the supported methods, and the supported methods would vary depeding on the resource’s state. In my … Read more

“Age: 0” HTTP Header

See the HTTP 1.1 specification on what the Age header field is intended to be used for: The Age response-header field conveys the sender’s estimate of the amount of time since the response (or its revalidation) was generated at the origin server. This information is used by intermediate proxies to convey an estimate of how … Read more

How should a client pass a facebook access token to the server?

If you look at the API endpoints provided by all popular OAuth providers (Google, Facebook, Pocket, Git etc), you’d see that they all have HTTPS endpoints. The ways in which you can pass an access token to the provider are – i) As Query Parameter – https://yourwebsite.com/api/endpoint?access_token=YOUR_ACCESS_TOKEN ii) In the request header – GET /api/users/123/profile … Read more

Doing http requests through a SOCKS5 proxy in NodeJS

I’ve just published two modules that should help you do this: socks5-http-client and socks5-https-client. Just use those instead of the default http module. The API is the same. For example: require(‘socks5-http-client’).request(options, function(res) { console.log(‘STATUS: ‘ + res.statusCode); console.log(‘HEADERS: ‘ + JSON.stringify(res.headers)); res.setEncoding(‘utf8’); res.on(‘data’, function (chunk) { console.log(‘BODY: ‘ + chunk); }); });

Instagram/feed API media URL shows ‘URL signature expired’

You could use the media URL with some extra parameters as a solution to get the desired image instead of using the direct image link. For example https://www.instagram.com/p/Bo7OXJ3hYM8/media/?size=m Notice the addon /media/?size=m Letters could be t, m or l for different picture sizes This should return you the desired image Reference: https://www.instagram.com/developer/embedding/

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