11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If the response status indicates that redirection is needed (status 301, 302, 305 or<br />

307), it will be performed automatically, up to five consecutive redirections (the limit<br />

is set to prevent looping, suggested by RFC 2616).<br />

If the response status is 401 or 407 (access denied), the response headers will be<br />

examined to see if the server requires (or accepts) Basic authentication. If no Basic<br />

authentication request is found, the function will return with an error. Otherwise<br />

default Authentication (set by setHTTPDefault) will be used to resend the request.<br />

If no default authentication is set, and no other cached user authentication is found,<br />

the function will return with an error.<br />

If the user provides authentication information through “Authorization” or “Proxy-<br />

Authorization” header, the encoded information is cached. If later, a Basic authentication<br />

request is raised, no default authentication is found, and only one<br />

user/password encoding is cached, then it will be used to resend the request.<br />

The response from the HTTP server is disposed into response_header and<br />

response_data. It is the user’s responsibility to parse the headers and data. <strong>UniBasic</strong><br />

only performs transfer encoding (chunked encoding), and nothing else is done on the<br />

data. In other words, content-encoding (gzip, compress, deflate, and so forth) are<br />

supposed to be handled by the user, as with all MIME types.<br />

Also, if a response contains header “Content-type: multipart/*”, all the data (multiple<br />

bodies enclosed in “boundary delimiters”, see RFC 2046) will be stored in<br />

response_data. It is the user’s responsibility to parse it according to “boundary”<br />

parameter.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

1-876 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

request_handle The handle to the request.<br />

time_out The timeout value (in milliseconds) before the wait response is<br />

abandoned.<br />

post_data The data sent with the POST request.<br />

submitRequest Parameters

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!