WebServer send200Response:
Last updated at 2:27 pm UTC on 7 September 2017
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:
GET an entity corresponding to the requested resource is sent in the response;
send200Response: aString
"Send a 200 OK response"
^self
send200Response: (aString convertToWithConverter: UTF8TextConverter new)
contentType: 'text/plain; charset=utf-8'.
send200Response: aString contentType: contentType
"Send a 200 OK response"
^self send200Response: aString contentType: contentType do:[:resp]
send200Response: aString contentType: contentType do: aBlock
"Send a 200 OK response"
| resp |
resp := self newResponse protocol: 'HTTP/1.1' code: 200.
resp headerAt: 'Content-Type' put: contentType.
aBlock value: resp.
^self sendResponse: resp content: aString.