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.
  • Properties specific to the description of httpResponse variables
  • Multiple HTTP responses
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
httpResponse (Type of variable)
In french: httpRéponse
The httpResponse type is used to get the advanced characteristics of the response of HTTP/HTTPS request. The characteristics of this response can be defined and modified using different WLanguage properties.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
Versions 22 and later
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
New in version 22
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
Android Widget This type of variable is now available in Android Widget mode.
Android This type of variable is now available for Android applications.
Example
cMyRequest is httpRequest
cMyResponse is httpResponse
cMaQuery.URL = "http://www.pcsoft.fr"
cMyResponse = HTTPSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info( cMaReply.Contents)
END
Remarks

Properties specific to the description of httpResponse variables

The following properties can be used to handle the response of an HTTP/HTTPS request:
Property nameType usedEffect
StatusCodeIntegerStatus of response. This property corresponds to one of the codes of HTTP protocol. The most common codes are:
  • 200: Request successfully processed
  • 301: Document moved permanently
  • 302: Document moved temporarily
  • 403: The server understood the request but it refuses to run it.
  • 404: Resource not found
  • 500: Internal server error
  • 503: Service temporarily unavailable or in maintenance
The HEX@ CodeEtat property allows to obtain the HEX@ of the error code.
This property is available in read-only.
ContentTypeCharacter stringString: Type of content for the received HTTP message.
This property is available in read-only.
ContentBufferBody of server response.
This property is available in read-only.
DescriptionStatusCodeCharacter stringHEX@ corresponding to Property State Code.
This property is available in read-only.
HeaderAssociative array of character stringsKey/Value set of received headers.
RoughHeaderCharacter stringHeader that was returned with the response.
This property is available in read-only.

Multiple HTTP responses

If the response contains multiple HTTP results (for example, if a proxy adds an HTTP code) the properties StatusCode and DescriptionStatusCode return the values of the first HTTP response.. In this case, the Property Brut header contains all the answers.
Minimum version required
  • Version 20
This page is also available for…
Comments
Video HttpResonse
https://youtu.be/-BpL9wZDmeM

https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2026-windev-mobile-webservice-022.html


SOLICITACAO_HTTP is httpRequest
RESPOSTA_HTTP is httpResponse
sUrl is string="http://nots-amarildo/empresa/{nEmpresaid}"
sUrl=Replace(sUrl,"{nEmpresaid}","13")
SOLICITACAO_HTTP..URL = sUrl
SOLICITACAO_HTTP..Method = httpDelete
SOLICITACAO_HTTP..ContentType = "multipart/form-data"
SOLICITACAO_HTTP..Content = ""
HTTPCreateForm("FormData")
RESPOSTA_HTTP = HTTPSendForm("FormData", SOLICITACAO_HTTP)
EDT_RETORNO=RESPOSTA_HTTP..Content
amarildo
25 Feb. 2019