HTTPServerResponse

Object for handling HTTP response.

end(data=T)

End a response to a client that made a request to the httpserver

If the headers were not send yet, a HTTP code 200 will be send.

Arguments:
data

(String | ArrayBuffer): The data to send out

write(data=F)

Respond to a client that made a request to the httpserver.

Arguments:
data

(String | ArrayBuffer): The data to send out

writeHead(statuscode=F, kvpairs=T)

Set the headers on a response to a client that made a request to the httpserver. Of course this can only happen if the headers were not send before.

Arguments:
statuscode (Integer)

The HTTP code to set (e.g. 200)

kvpairs (Object)

Header data object


Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!