PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Notes
  • Security error in a secure transaction
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Sends an HTTP request and waits for the response from the HTTP server.
Versions 22 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 22
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
Example
cMaRequête is httpRequest
cMaRequête.URL = "http://www.pcsoft.fr"
cMaRéponse is httpResponse = HTTPSend(cMaRequête)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMaRéponse.Content)
END
Syntax

Syntax with 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 interrogate.
Versions 22 and later
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Asynchronous syntax with an httpRequest variable Hide the details

HTTPSend(<HTTP request> , <WLanguage procedure>)
<HTTP request>: httpRequest variable
Name of the httpRequest variable that contains the characteristics of the HTTP request to be sent to the server.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
New in version 22
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Asynchronous syntax with an httpRequest variable Hide the details

HTTPSend(<HTTP request> , <WLanguage procedure>)
<HTTP request>: httpRequest variable
Name of the httpRequest variable that contains the characteristics of the HTTP request to be sent to the server.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Asynchronous syntax with an httpRequest variable Hide the details

HTTPSend(<HTTP request> , <WLanguage procedure>)
<HTTP request>: httpRequest variable
Name of the httpRequest variable that contains the characteristics of the HTTP request to be sent to the server.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
Versions 22 and later
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage procedure>)
<URL>: Character string
URL to interrogate.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
New in version 22
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage procedure>)
<URL>: Character string
URL to interrogate.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
WEBDEV - Browser code Available in WINDEV, Android and iPhone from version 26 onwards

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage procedure>)
<URL>: Character string
URL to interrogate.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called during the response from the HTTP server. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Réponse> est une httpRéponse)
where <Response> is an httpResponse variable containing the response received from the HTTP server.
Remarks

Notes

  • To find out the runtime errors of this function, use ErrorOccurred and ErrorInfo.
  • If cookies have been implemented for the specified request (HTTPCookieManage), they are updated in the HTTPSend variable after the call to httpRequest. Therefore, during the next call to HTTPSend with this request, the cookies will be taken into account.
  • Versions 21 and later
    From version 21, the redirections are automatically taken into account in the HTTP requests. To manually handle redirects in HTTP requests, it is necessary to use the IgnoreError property of the httpRequest type variable with the httpIgnoreRedirectionconstant.
    New in version 21
    From version 21, the redirections are automatically taken into account in the HTTP requests. To manually handle redirects in HTTP requests, it is necessary to use the IgnoreError property of the httpRequest type variable with the httpIgnoreRedirectionconstant.
    From version 21, the redirections are automatically taken into account in the HTTP requests. To manually handle redirects in HTTP requests, it is necessary to use the IgnoreError property of the httpRequest type variable with the httpIgnoreRedirectionconstant.
  • WEBDEV - Browser code 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 avoid being blocked, 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 coming from an unknown company.
  • the site name specified in the certificate does not correspond to a server.
  • invalid or expired certificate date.
  • redirection to a non-secure server.
These errors are returned by ErrorInfo.
If one of these errors occurs, you can re-run the request while ignoring the errors. To do this, simply change the Property IgnoreError of type Variable to httpRequest:
Error returned by ErrorInfo
(with the errCode constant)
Value of the Property IgnoreError of the Variable of type httpRequest
(these values can be combined)
Description
httpErrorInvalidCertificate
Invalid certificate or certificate coming from an unknown company
httpIgnoreInvalidCertificateThe certificate is ignored.
httpErrorInvalidCertificateName
The site name specified in the certificate does not correspond to a server
httpIgnoreInvalidCertificateNameThe site name specified in the certificate is ignored.
httpErrorExpiredCertificate
Invalid or expired certificate date
httpIgnoreExpiredCertificateThe certificate date is ignored
httpErrorRedirectToHTTP
Redirection to a non-secure server
httpIgnoreRedirectToHTTPThe redirection to a non-secure server is allowed.
httpIgnoreRedirectToHTTPS
Redirection to a secure server
httpIgnoreRedirectToHTTPSThe redirection to a secure server is allowed.
httpIgnoreRevocationThe certificate found in the list of revoked certificates is not checked.
Remarks:
  • When the HTTP queries are run in several threads, the HTTP.IgnoreError variable has a specific value for each thread.
Business / UI classification: Business Logic
Component: wd270com.dll
Minimum version required
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment