From e7b96001dc242cdd6ba5218a34c7bea65c2dbe3b Mon Sep 17 00:00:00 2001 From: Sam Blowes Date: Mon, 8 Jun 2015 11:54:21 +0100 Subject: [PATCH] Fixed the wrong tab being active by default Revised version of another PR , see https://github.com/tfredrich/RestApiTutorial.com/pull/26 --- lessons/httpmethods.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lessons/httpmethods.html b/lessons/httpmethods.html index 1e9bc88..cb1a39f 100644 --- a/lessons/httpmethods.html +++ b/lessons/httpmethods.html @@ -102,7 +102,7 @@
  • DELETE
  • -
    +

    The POST verb is most-often utilized to **create** new resources. In particular, it's used to create subordinate resources. That is, subordinate to some other (e.g. parent) resource. In other words, when creating a new resource, POST to the parent and the service takes care of associating the new resource with the parent, assigning an ID (new resource URI), etc.

    On successful creation, return HTTP status 201, returning a Location header with a link to the newly-created resource with the 201 HTTP status.

    POST is neither safe nor idempotent. It is therefore recommended for non-idempotent resource requests. Making two identical POST requests will most-likely result in two resources containing the same information.

    @@ -112,7 +112,7 @@
  • POST http://www.example.com/customers/12345/orders
  • -
    +

    The HTTP GET method is used to **read** (or retrieve) a representation of a resource. In the “happy” (or non-error) path, GET returns a representation in XML or JSON and an HTTP response code of 200 (OK). In an error case, it most often returns a 404 (NOT FOUND) or 400 (BAD REQUEST).

    According to the design of the HTTP specification, GET (along with HEAD) requests are used only to read data and not change it. Therefore, when used this way, they are considered safe. That is, they can be called without risk of data modification or corruption—calling it once has the same effect as calling it 10 times, or none at all. Additionally, GET (and HEAD) is idempotent, which means that making multiple identical requests ends up having the same result as a single request.

    Do not expose unsafe operations via GET—it should never modify any resources on the server.