|
- Notes
- Security error in a secure transaction
- Required permissions
HTTPSend (Function) In french: HTTPEnvoie Sends an HTTP request and waits for the response from the HTTP server. Versions 22 and later New in version 22
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 that is 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 httpRequest variable containing the characteristics of the HTTP request that will be sent to the server.
Simplified syntax for sending a request Hide the details
<HTTP response> = HTTPSend(<URL>)
<HTTP response>: httpResponse variable Name of httpResponse variable containing the response received from the HTTP server. <URL>: Character string (with quotes) URL to interrogate. Remarks Notes - To find out the runtime errors of this function, use ErrorOccurred and ErrorInfo.
- If the management of cookies is implemented for the specified request (HTTPCookieManage), the cookies 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.
Versions 21 and laterFrom version 21, the redirections are automatically taken into account in the HTTP requests. To manually process the redirections in the HTTP requests, you must use ..IgnoreError of httpRequest variable associated with the httpIgnoreRedirection constant. New in version 21From version 21, the redirections are automatically taken into account in the HTTP requests. To manually process the redirections in the HTTP requests, you must use ..IgnoreError of httpRequest variable associated with the httpIgnoreRedirection constant. From version 21, the redirections are automatically taken into account in the HTTP requests. To manually process the redirections in the HTTP requests, you must use ..IgnoreError of httpRequest variable associated with the httpIgnoreRedirection constant.  Up to version 23, this function is available only for devices with ARM processors. A fatal error occurs if this function is used with devices not equipped with ARM processors (x86, mips, ...). Up to version 23, this function is available only for devices equipped with ARM processors or an ARM emulator. Otherwise (and on the Samsung Galaxy Tab 3 tablet), a fatal error will occur. From version 24, devices equipped with x86 processors (therefore Samsung Galaxy Tab 3 tablets) can use this function as well.
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.
If one of these errors occurs, you can re-run the request while ignoring the errors. To do so, all you have to do is modify the ..IgnoreError property of httpRequest variable: | | | Error returned by ErrorInfo (with the errCode constant) | Value of ..IgnoreError property of httpRequest variable (these values can be combined) | Description |
---|
httpErrorInvalidCertificate Invalid certificate or certificate coming from an unknown company | httpIgnoreInvalidCertificate | The certificate is ignored. | httpErrorInvalidCertificateName The site name specified in the certificate does not correspond to a server | httpIgnoreInvalidCertificateName | The site name specified in the certificate is ignored. | httpErrorExpiredCertificate Invalid or expired certificate date | httpIgnoreExpiredCertificate | The certificate date is ignored | 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. | | httpIgnoreRevocation | The 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.
Versions 22 and later The following errors are supported: httpIgnoreExpiredCertificate, httpIgnoreInvalidCertificate, httpIgnoreInvalidCertificateName, httpIgnoreRevocation, httpIgnoreRedirection. New in version 22 The following errors are supported: httpIgnoreExpiredCertificate, httpIgnoreInvalidCertificate, httpIgnoreInvalidCertificateName, httpIgnoreRevocation, httpIgnoreRedirection.  The following errors are supported: httpIgnoreExpiredCertificate, httpIgnoreInvalidCertificate, httpIgnoreInvalidCertificateName, httpIgnoreRevocation, httpIgnoreRedirection.
Versions 22 and later New in version 22
This page is also available for…
|
|
|
| |
| Download de Imagem e exibição no mobile |
|
| iNomeImg is Image bufMyBuffer2 is Buffer sEndImagem is string cMyResponse is httpResponse
SOLICITACAO_HTTP is httpRequest
SOLICITACAO_HTTP..URL = "http://crm.intellisys.com.br/IMG/Intellisys/Produtos/01.jpg" SOLICITACAO_HTTP..Method = httpGet SOLICITACAO_HTTP..ContentType = typeMimeJPEG
cMyResponse = HTTPSend(SOLICITACAO_HTTP)
Trace("Status Code: " + cMyResponse..StatusCode)
IF ErrorOccurred THEN Error(ErrorInfo(errFullDetails)) ELSE Trace("Conteudo: " + cMyResponse..Content) bufMyBuffer2 = cMyResponse..Content END
IMG_transicao = dLoadImage(bufMyBuffer2) |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
| |