|
|
|
|
|
- Security error in a secure transaction
- Required permissions
RESTSend (Function) In french: RESTEnvoie Sends a REST request and waits for the server response. cMaRequete is httpRequest
cMaRequete.URL = "<adresse serveur>"
cMaReponse is httpResponse = RESTSend(cMaRequete)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMaReponse.Content)
END
cMyRequest is httpRequest
cMyRequest.Method = httpGet
cMaRequete.URL = "http://<IP du serveur>/CDM/UpdateBandeauhaut/1"
cMyResponse is httpResponse = RESTSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
IF cMyResponse.Content = True THEN
Info("The site was updated.")
ELSE
Error(cMyResponse.Content)
END
END
Syntax
Syntax that uses a restRequest variable Hide the details
<REST response> = RESTSend(<REST request>)
<REST response>: restResponse variable Name of the restResponse variable containing the response received from the REST server. <REST request>: restResponse variable Name of the restRequest variable that contains the characteristics of the REST request to be sent to the server.
Simplified syntax for sending a request Hide the details
<REST response> = RESTSend(<URL>)
<REST response>: restResponse variable Name of the restResponse variable containing the response received from the REST server. <URL>: Character string URL to interrogate. Remarks      To find out the runtime errors of this function, use ErrorOccurred and ErrorInfo. Access to REST APIs from a domain other than the one hosting the site from a browser code (Cross-domain) is blocked by default (Cross-Origin Request Blocked). To allow this access, specific authorizations must be configured on the web server. This topic is covered in the following post on the support blog: https://blogs.pcsoft.fr/fr/autoriser-acces-api-rest-domaine-cors
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 restRequest 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|