sercrod

*post

*post sends selected host data or staged data as a Sercrod JSON request envelope with HTTP POST.

<serc-rod data='{"form":{"name":"","message":""},"result":null}'>
  <input *input="form.name">
  <textarea *input="form.message"></textarea>

  <button
    type="button"
    *post="'/api/contact.php'"
    *keys="form"
    *params="{ source: 'contact-form' }"
    *response="'result'">
    Send
  </button>
</serc-rod>

*post does not use the old URL suffix response placement form. Use *response for placement.

Request envelope

{
  "sercrod": {
    "origin": "sercrod",
    "request_type": "post",
    "dry_run": false,
    "target": "/api/contact.php",
    "directive": "*post"
  },
  "data": {},
  "params": {}
}

When *dry-run is present, sercrod.dry_run becomes true and sercrod.request_type becomes "dry-run".

Response placement

Every successful response is mirrored to $response. Without *response, normal host data is not changed.