handle.getResponseCode
Returns the numerical HTTP response code sent by the server.
  | 
  |||
| Gets the response code of "https://example.com" and print it. | |||
| Code | local response, err = http.get("https://example.com")
if not response then error(err, 0) end
print(response.getResponseCode())
 | 
    ||
| Output | 200 OK  | 
    ||
Functions  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua | 
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked | 
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| handle.getResponseCode Function  | |
|---|---|
| 
Syntax handle.getResponseCode()  | |
| Returns | number code string status | 
| API | http | 
| Source | CC:Tweaked (source) | 
    This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.