concept action in category go

appears as: action, Action, Actions, ctions, n action, ction, actions
Go Web Programming

This is an excerpt from Manning's book Go Web Programming.

Although the HTTP request method defines the action requested by the calling client, other information on the request or the client is often placed in HTTP request headers. Request headers are colon-separated name-value pairs in plain text, terminated by a carriage return (CR) and line feed (LF).

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Go Web Programming</title>
  </head>
  <body>
    <form action=http://127.0.0.1:8080/process?hello=world&thread=123
     method="post" enctype="application/x-www-form-urlencoded">

      <input type="text" name="hello" value="sau sheong"/>
      <input type="text" name="post" value="456"/>
      <input type="submit"/>
    </form>
  </body>
</html>

If you’re looking at REST for the first time, you might be thinking that it’s all well and good if we’re only talking about a simple CRUD application. What about more complex services, or where you have to model some process or action?

7.3.2. Make the action a property of the resource

If activation is a simple state of the customer account, you can simply make the action a property of the resource, and then use the PATCH HTTP method to do a partial update to the resource. For example, you can do this: