Epson TM-m50II Epson POS Printer WebAPI Interface Specification - Page 26

Response, Error response

Page 26 highlights

4.2. Response All of the APIs use the Status-Line on the HTTP response message as below. Elements HTTP-Version Status-Code and Reason-Phrase Response Header fields Allowed value "HTTP/1.1" "200" OK "400" Bad Request "404" Not Found "500" Internal Server Error Comply with RFC 2616. If Status-Code is 200 OK, the Device returns the following fields. Pragma: no-cache Cache-Control: no-cache Content-Type: application/json; charset=UTF-8 Table 4-2 Response Message Here's an example HTTP response. ----- begin --1:HTTP/1.1 200 OK *HTTP-Version, *Status-Code, *Reason-Phrase 2:Pragma: no-cache 3:Cache-Control: no-cache 4:Connection: keep-alive 5:Content-Length: 893 6:Content-Type: application/json; charset=UTF-8 *Content-Type 7: 8:{ "result":"success" } *Message Body (JSON) ----- end --- 4.3. Error response Errors are returned from APIs in the following format by JSON in a 200 (OK) response. Name result Value type string Value Indicates the error reason defined by each API. Table 4-3 API Error Response Epson POS Printer WebAPI Interface Specification Revision A M00152302 September 8, 2022 Page: 26

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

Epson POS Printer WebAPI Interface Specification
Revision A
September 8, 2022
M00152302
Page: 26
4.2.
Response
All of the APIs use the Status-Line on the HTTP response message as below.
Elements
Allowed value
HTTP-Version
“HTTP/1.1”
Status-Code
and Reason-Phrase
“200” OK
“400” Bad Request
“404” Not Found
“500” Internal Server Error
Response Header fields
Comply with RFC 2616.
If Status-Code is 200 OK, the Device returns the following fields.
Pragma: no-cache
Cache-Control: no-cache
Content-Type:
application/json; charset=UTF-8
Table 4-2 Response Message
Here’s an example HTTP response.
----- begin ---
1:HTTP/1.1 200 OK
*HTTP-Version, *Status-Code, *Reason-Phrase
2:Pragma: no-cache
3:Cache-Control: no-cache
4:Connection: keep-alive
5:Content-Length: 893
6:Content-Type: application/json; charset=UTF-8
*Content-Type
7:
8:{
"result":"success"
}
*
Message Body (JSON)
----- end ---
4.3.
Error response
Errors are returned from APIs in the following format by JSON in a 200 (OK) response.
Name
Value type
Value
result
string
Indicates the error reason defined by each API.
Table 4-3 API Error Response