PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Security error in a secure transaction
  • Retrieval
  • Accessing a password-protected URL
  • Using a proxy
  • Authentication headers
  • Limits
  • Required application feature
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Sends an HTTP form. This form was created by HTTPCreateForm.
Versions 16 and later
PHP This function is now available for the PHP sites.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
PHP This function is now available for the PHP sites.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
PHP This function is now available for the PHP sites.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 18 and later
iPhone/iPad This function is now available for the iPhone/iPad applications, in HTTP only (not in HTTPS).
New in version 18
iPhone/iPad This function is now available for the iPhone/iPad applications, in HTTP only (not in HTTPS).
iPhone/iPad This function is now available for the iPhone/iPad applications, in HTTP only (not in HTTPS).
Versions 19 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 19
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Versions 20 and later
iPhone/iPad This function is now available for the iPhone/iPad applications in HTTPS.
Linux This function is now available for the applications and sites in Linux in HTTPS.
New in version 20
iPhone/iPad This function is now available for the iPhone/iPad applications in HTTPS.
Linux This function is now available for the applications and sites in Linux in HTTPS.
iPhone/iPad This function is now available for the iPhone/iPad applications in HTTPS.
Linux This function is now available for the applications and sites in Linux in HTTPS.
HTTPCreateForm("FORM")
HTTPAddParameter("FORM", "Price", "3400")
...
HTTPSendForm("FORM", "www.mysite.com")
// Example for sending a file
lIdForm = "TEST"
HTTPCreateForm(lIdForm)
HTTPAddFile(lIdForm, "file", "C:\temp\Certificate.pdf")
IF NIT HTTPSendForm(lIdForm, "http://test.myserver.net", httpPost, "AGENT") THEN
...
END
Syntax

Full syntax Hide the details

<Result> = HTTPSendForm(<Form Name> , <URL to Contact> [, <HTTP Method> [, <User Agent> [, <Additional HTTP Header> [, <Type of Form> [, <User Name> [, <Password>]]]]]])
<Result>: Boolean
  • True if the HTTP form was sent,
  • False if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Form Name>: Character string (with quotes)
Name of HTTP form to send.
<URL to Contact>: Character string (with quotes)
Address of server to contact (URL address).
This parameter can contain the port number for connecting to the server. The default value is 80 (corresponds to a server of Web pages). To specify a port number, use the following format: "<Server URL>:<Port #>".
For example: http://www.pcsoft.fr:80.
Note: To perform a secure transaction, the URL must start with "https://".
LinuxiPhone/iPad The secure transactions are not supported.
<HTTP Method>: Optional Integer constant
HTTP method used:
Versions 19 and later
httpCopy
New in version 19
httpCopy
httpCopy
COPY method
AndroidAndroid Widget Java This constant is not available.
Versions 22 and later
AndroidAndroid Widget This constant is now available.
New in version 22
AndroidAndroid Widget This constant is now available.
AndroidAndroid Widget This constant is now available.
Java This constant is not available.
httpDeleteDELETE method
httpGetGET method
Versions 19 and later
httpHead
New in version 19
httpHead
httpHead
HEAD method
AndroidAndroid Widget Java This constant is not available.
Versions 22 and later
AndroidAndroid Widget This constant is now available.
New in version 22
AndroidAndroid Widget This constant is now available.
AndroidAndroid Widget This constant is now available.
Java This constant is not available.
Versions 19 and later
httpPatch
New in version 19
httpPatch
httpPatch
PATCH method
AndroidAndroid Widget Java This constant is not available.
Versions 22 and later
AndroidAndroid Widget This constant is now available.
New in version 22
AndroidAndroid Widget This constant is now available.
AndroidAndroid Widget This constant is now available.
Java This constant is not available.
httpPost
(Default value)
POST method
httpPutPUT method
<User Agent>: Optional character string (with quotes)
Identifies the client. The "PC SOFT Framework" value is returned by default.
The content of the response may depend on the user agent. In this case, see the documentation of user agent for more details.
Windows Mobile Identifies the client. The "Mozilla/4.0 (compatible; MSIE 4.01 - Windows CE)" value is returned by default.
Indeed, the content of the response may depend on the user agent. For example, if the default value is used, the size of pages displayed will be adapted to the Pocket PC screen (only if this features is supported by the server of site viewed).
<Additional HTTP Header>: Optional character string (with quotes)
  • Additional HTTP header that will be added to the HTTP message. Caution: this string must end with a CR character (Carriage Return).
  • Empty string ("") if no HTTP header must be added.
<Type of Form>: Optional character string (with quotes) or optional constant
Type of form that will be sent to the server. This parameter corresponds to "Content-Type".
By default, the message type corresponds to: "application/x-www-form-urlencoded".
Versions 22 and later
This parameter can correspond to one of the following constants:
typeMimeMultiPartFormThe message type corresponds to: "multipart/form-data" (mainly used to transfer files).
typeMimeSimpleForm
(Default value)
The message type corresponds to: "application/x-www-form-urlencoded".
New in version 22
This parameter can correspond to one of the following constants:
typeMimeMultiPartFormThe message type corresponds to: "multipart/form-data" (mainly used to transfer files).
typeMimeSimpleForm
(Default value)
The message type corresponds to: "application/x-www-form-urlencoded".
This parameter can correspond to one of the following constants:
typeMimeMultiPartFormThe message type corresponds to: "multipart/form-data" (mainly used to transfer files).
typeMimeSimpleForm
(Default value)
The message type corresponds to: "application/x-www-form-urlencoded".
<User Name>: Optional character string (with quotes)
Name used to access a page with a protected URL (empty string by default). This name is used to identify the user.
<Password>: Optional character string (with quotes)
Password associated with the user name (empty string by default). Used to access a page with a protected URL. Caution: The password is not encrypted when it is sent on Internet.
Versions 20 and later
WINDEVWEBDEV - Server codeiPhone/iPadAjax

Syntax that is using the httpRequest type Hide the details

<Result> = HTTPSendForm(<Form Name> , <HTTP Request>)
<Result>: httpResponse variable
Name of httpResponse variable containing the response from the request.
<Form Name>: Character string (with quotes)
Name of HTTP form to send.
<HTTP Request>: httpRequest variable
Name of httpRequest variable containing the parameters required to send the form.
New in version 20
WINDEVWEBDEV - Server codeiPhone/iPadAjax

Syntax that is using the httpRequest type Hide the details

<Result> = HTTPSendForm(<Form Name> , <HTTP Request>)
<Result>: httpResponse variable
Name of httpResponse variable containing the response from the request.
<Form Name>: Character string (with quotes)
Name of HTTP form to send.
<HTTP Request>: httpRequest variable
Name of httpRequest variable containing the parameters required to send the form.
WINDEVWEBDEV - Server codeiPhone/iPadAjax

Syntax that is using the httpRequest type Hide the details

<Result> = HTTPSendForm(<Form Name> , <HTTP Request>)
<Result>: httpResponse variable
Name of httpResponse variable containing the response from the request.
<Form Name>: Character string (with quotes)
Name of HTTP form to send.
<HTTP Request>: httpRequest variable
Name of httpRequest variable containing the parameters required to send the form.
Remarks

Security error in a secure transaction

During a secure transaction, the sending of the form may fail due to security errors:
  • invalid certificate or certificate coming from an unknown company.
  • the name of the site 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.
Two methods can be used according to the syntax:
  • Syntax 1: using the HTTP.IgnoreError variable (see the paragraph below).
  • Versions 20 and later
    WINDEVWEBDEV - Server codeiPhone/iPadAjax Syntax 2: using the ..IgnoreError property of httpRequest variable.
    New in version 20
    WINDEVWEBDEV - Server codeiPhone/iPadAjax Syntax 2: using the ..IgnoreError property of httpRequest variable.
    WINDEVWEBDEV - Server codeiPhone/iPadAjax Syntax 2: using the ..IgnoreError property of httpRequest variable.
If the full syntax is used (syntax 1), all you have to do is use the HTTP.IgnoreError variable:
Error returned by ErrorInfo
(with the errCode constant)
Value of HTTP.IgnoreError
(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.
For example:
// Send a form on a secure server
ResStart = HTTPSendForm("FORM", "https://www.MyServer.com")
// If an error occurs
IF ResStart = False THEN
// According to the type of error
SWITCH ErrorInfo(errCode)
  // Invalid certificate or coming from an unknown company
  CASE httpErrorInvalidCertificate:
// Ignore the certificate?
IF YesNo("Caution, a security alert was detected!", ...
 "The certificate is invalid.", ...
"Do you want to ignore this certificate?") = Yes THEN
HTTP.IgnoreError = httpIgnoreInvalidCertificate
// Send the form again while ignoring this error
HTTPSendForm("FORM", "https://www.MyServer.com")
END
// Invalid or expired certificate date
CASE httpErrorExpiredCertificate:
// Ignore the certificate date?
IF YesNo("Caution, a security alert was detected!", ...
"The certificate date is invalid or expired.", ...
"Do you want to ignore this date?") = Yes THEN
HTTP.IgnoreError = httpIgnoreExpiredCertificate
// Send the form again while ignoring this error
HTTPSendForm("FORM", "https://www.MyServer.com")
END
END
END
AndroidAndroid Widget The errors regarding the security of transactions are not returned by ErrorInfo (the connection is refused). These errors cannot be ignored. The HTTP.IgnoreError variable is not available.

Retrieval

HTTPGetResult is used to retrieve the result of last HTTP form sent.

Accessing a password-protected URL

To access a password-protected URL, you can:
  • use the <User Name> and <Password> parameters found in HTTPSendForm.
  • specify the login and password in the <URL to Contact> parameter.
    For example:
    <Result> = HTTPSendForm("http://<user>:<password>@<URL to contact>")

Using a proxy

To access the URL specified in HTTPSendForm via a proxy, use Proxy.

Authentication headers

The authentication headers are automatically generated in the following cases:
  • If HTTPSendForm is using the syntax with login and password.
  • If the server URL is password protected
  • If Proxy is used.
AndroidAndroid Widget

Limits

This function is available for the devices equipped with ARM processors. A fatal error occurs if this function is used with devices not equipped with ARM processors (x86, mips, ...). This function is available for the devices equipped with ARM processors or using an ARM emulation. Otherwise (and on the Samsung Galaxy Tab 3 tablet), a fatal error will occur.
Versions 21 and later
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Internet and public networks (outgoing).
This feature allows the applications to use the accesses to Internet and to the public networks.
New in version 21
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Internet and public networks (outgoing).
This feature allows the applications to use the accesses to Internet and to the public networks.
Universal Windows 10 App

Required application feature

The use of this function triggers the declaration of an application feature in the wizard for generating the application.
Required feature: Internet and public networks (outgoing).
This feature allows the applications to use the accesses to Internet and to the public networks.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment