PUT

PUT Method

Subject to authorization, the HTTP PUT method works in Pagelove as per the HTTP specification.

When a selector range unit is used alongside the PUT method, if the requested node is present in the document, it is replaced with the body of the HTTP message.

PUT /index.html HTTP/2
Range: selector=h1
Content-Type: text/html
Content-Length: 19

<h1>New Header</h1>

If the HTTP request is successful, the client receives a 206 Partial Content message back from the server. The response headers will include a Content-Range header that indicates the element that has been modified with the Content-Range header, and the body of the message set to the serialized HTML of the element.

HTTP/2 206 Partial Content
Content-Range: selector=h1
ETag: gen-9219
Content-Length: 19

<h1>New Header<h1>

If the request refers to a resource that doesn't exist, a 404 Not Found is returned. If the resource exists, but the CSS selector is invalid, a 416 Range not Satisfiable message is sent.