|
|
|
|
|
- Notes
- Security error in a secure transaction
- Required permissions
HTTPSend (Function) In french: HTTPEnvoie Sends an HTTP request. Two modes are available - send HTTP request and wait for server response (blocking mode).
- send request without waiting for server response (asynchronous mode). The response will be processed by a WLanguage procedure.
cMyRequest is httpRequest
cMyRequest.URL = "http://www.windev.com"
cMyResponse is httpResponse = HTTPSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMyResponse.Content)
END
Syntax
Syntax using an httpRequest variable Hide the details
<HTTP response> = HTTPSend(<HTTP request>)
<HTTP response>: httpResponse variable Name of the httpResponse variable containing the response received from the HTTP server. <HTTP request>: httpRequest variable Name of the httpRequest variable that contains the characteristics of the HTTP request to be sent to the server.
Simplified syntax for sending a request Hide the details
<HTTP response> = HTTPSend(<URL>)
<HTTP response>: httpResponse variable Name of the httpResponse variable containing the response received from the HTTP server. <URL>: Character string URL to query. Remarks Notes - To identify the execution errors of this function:
- If the server cannot be reached, use ErrorOccurred and ErrorInfo.
- If the server can be reached, use the StatusCode property of the httpResponse variable to get the response. By default, 200 indicates that the request has been accepted. Other HTTP codes will indicate errors, if any.
- If cookies have been implemented for the specified request (HTTPCookieManage), they are updated in the httpRequest variable after the call to HTTPSend. Therefore, during the next call to HTTPSend with this request, the cookies will be taken into account.
- From version 21, redirections are automatically taken into account in HTTP requests. To manually process redirections in HTTP requests, you must use the IgnoreError property of the httpRequest variable with the httpIgnoreRedirection constant.
Security error in a secure transaction During a secure transaction, the request may fail due to security errors: - invalid certificate or certificate issued by an unknown organization.
- the site name specified in the certificate does not correspond to a server
- invalid or expired certificate date.
- redirection to a non-secure server.
If one of these errors occurs, you can run the request again, ignoring the errors. To do so, simply modify the IgnoreError property of the httpRequest variable: | | | Error returned by ErrorInfo (with the errCode constant) | Value of the IgnoreError property of the httpRequest variable (these values can be combined) | Description |
---|
httpErrorInvalidCertificate Invalid certificate or certificate issued by an unknown organization. | httpIgnoreInvalidCertificate | Ignores the certificate. | httpErrorInvalidCertificateName The site name specified in the certificate does not correspond to a server. | httpIgnoreInvalidCertificateName | Ignores the site name specified in the certificate. | httpErrorExpiredCertificate Invalid or expired certificate date. | httpIgnoreExpiredCertificate | Ignores the certificate date. | | httpIgnoreDeprecated | Ignores errors related to the use of deprecated algorithms (e.g. SHA-1 certificate signature). | httpErrorRedirectToHTTP Redirection to a non-secure server. | httpIgnoreRedirectToHTTP | The redirection to a non-secure server is allowed. | httpIgnoreRedirectToHTTPS Redirection to a secure server. | httpIgnoreRedirectToHTTPS | The redirection to a secure server is allowed. | | httpIgnoreUnsafeRenegotiation | Ignores the error indicating that the server does not support secure renegotiation (RFC 5746). | | httpIgnoreRevocation | The certificate is not verified in the list of revoked certificates. |
Remarks: - When the HTTP queries are run in several threads, the HTTP.IgnoreError variable has a specific value for each thread.
 The following errors are handled: httpIgnoreExpiredCertificate, httpIgnoreInvalidCertificate, httpIgnoreInvalidCertificateName, httpIgnoreRevocation, httpIgnoreRedirection.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|