Skip to content

Instantly share code, notes, and snippets.

@siddharth-pandey
siddharth-pandey / http-status-codes.md
Created May 30, 2018 23:18 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@siddharth-pandey
siddharth-pandey / mock-service-example.js
Created November 25, 2016 22:19 — forked from alicial/mock-service-example.js
AngularJS: Setting up a mocked service to use in controller unit tests.
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Data;
public class TodoApiController : ApiController
{
private BetterMobileSpaContext db = new BetterMobileSpaContext();
// GET /api/todoapi
[Bb]in
[Oo]bj
*.suo
*.user
@siddharth-pandey
siddharth-pandey / CSS IR
Last active October 11, 2015 06:08 — forked from attegists/CSS: IR
CSS: IR
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}