GenerateHTTPResponse

GenerateHTTPResponse[expr]

gives the HTTPResponse object that is generated when a cloud object containing expr is requested on the web.

GenerateHTTPResponse[expr,req]

gives the response for the HTTP request specified by req.

Details

Examples

open allclose all

Basic Examples  (4)

Apply GenerateHTTPResponse to Delayed to locally simulate a cloud server:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

GenerateHTTPResponse recurses on the expression until it returns an HTTPResponse:

In[1]:=
Click for copyable input
Out[1]=

You can use an explicit HTTPResponse to set the StatusCode or the headers of the response:

In[1]:=
Click for copyable input
Out[1]=

Use ResponseForm to get a detailed report on the computation you've run:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (3)

Possible Issues  (1)

See Also

CloudDeploy  URLDispatcher  HTTPRequestData  URLRead  URLExecute

Introduced in 2015
(10.3)