Configuring Alerts Where the Alert Destination is HTTP POST
Configuring Alerts Where the Alert Destination is HTTP POST

Configuring Alerts Where the Alert Destination is HTTP POST

Any setting in the
alerts.http
branch that is set will take effect for any
HTTP POST
alerts that occur from that point forward. A printer reset is not required for the settings to take effect.
If the server is configured to accept and process
HTTP POST
messages either via a CGI script or a server-side script such as PHP or ASP then the alert can be forwarded to that server from the printer. The printer will send the alert using the multipart/form-data Content-Type. This allows any type of data, including binary data, to be sent via the
POST
.
The
POST
will support two variables within the body of the
POST
:
  • alertMsg – This is the alert details and the content follows the format of a standard alert when it is issued over one of the other alert destinations (for example, serial, USB, TCP, etc.).
  • uniqueId – The unique id of the printer. This matches the value in
    device.unique_id
    .
    The HTTP POST request will look as follows (sent when the printer was paused)
POST /http_post/alert.php HTTP/1.1 Host: 10.3.4.58 Accept: */* Connection: close Content-Length: 281 Expect: 100-continue Content-Type: multipart/form-data; boundary=----------------------------350c75835f46 ------------------------------350c75835f46 Content-Disposition: form-data; name="alertMsg" ALERT%3A%20PRINTER%20PAUSED ------------------------------350c75835f46 Content-Disposition: form-data; name="uniqueId" XXQLJ120900310 ------------------------------350c75835f46--
The message is using HTTP/1.1 and therefore HTTP/1.1 header fields. This is important because some older proxy servers do not handle these fields gracefully and may block the
POST
message.
It is important to note that the message is using HTTP/1.1 and therefore HTTP/1.1 header fields. This is important because some older proxy servers do not handle these fields gracefully and may block the POST message.