Learn R Programming

websockets (version 1.1.7)

http_response: Form and send an http response to a socket

Description

Form and send an http response to a socket

Usage

http_response(socket, status=200, content_type="text/html; charset=UTF-8", content="", headers=c())

Arguments

socket

A socket descriptor.

status

An http numeric status code.

content_type

The http content type.

content

The http content (normally of type raw).

headers

List or vector of additional headers to send with the response. All items must be named. Do not include Date, Content-Type or Content-Length headers.

Value

NULL is invisibly returned

Details

Form an http response and send it to the specified socket, closing the socket connection when done.

See Also

createContext create_server