type
constructors
make |
Create a new HttpReq instance. |
---|
fields
async |
If true then perform this request asynchronously. |
---|---|
headers |
The request headers to send. |
resType |
The type of data contained in the response. |
uri |
The Uri to send the request. |
withCredentials |
Indicates whether or not cross-site |
methods
get |
Convenience for |
---|---|
onProgress |
Optional callback to track progress of request transfers, where |
post |
Convenience for |
postForm |
Post the |
postFormMultipart |
Post the |
send |
Send a request with the given content using the given HTTP method (case does not matter). |
Slot Details
async
get
headers
make
onProgress
src
Void onProgress(|Int,Int| f)
Optional callback to track progress of request transfers, where loaded
is the number of bytes that have been transferred, and total
is the total number of bytes to be transferred.
For GET
requests, the progress will track the response being downloaded to the browser. For PUT
and POST
requests, the progress will track the content being uploaded to the server.
Note this callback is only invoked when lengthComputable
is true
on the underlying progress events.
post
postForm
postFormMultipart
resType
send
uri
withCredentials
src
Bool withCredentials := false
Indicates whether or not cross-site Access-Control
requests should be made using credentials such as cookies, authorization headers or TLS client certificates. Setting withCredentials
has no effect on same-site requests. The default is false
.
Requests from a different domain cannot set cookie values for their own domain unless withCredentials
is set to true
before making the request. The third-party cookies obtained by setting withCredentials
to true
will still honor same-origin policy and hence can not be accessed by the requesting script through Doc.cookies
or from response headers.