Help Center

CWinHttpRequest.GetResponseTextmethod

Retrieves the response entity body as a string.

COMmethoddocumented

Syntax

FUNCTION GetResponseText () AS DWSTRING

Return value

A DWSTRING containing the entity body of the response as text.

Description

Retrieves the response entity body.

Remarks

This method can only be invoked after the Send method has been called.

When using this property in synchronous mode, the limit to the number of characters it returns is approximately 2,169,895.

Example

#cmdline "-s console" #include once "AfxNova/CWinHttpRequest.inc" #include once "AfxNova/DWStrProcs.inc" using AfxNova

' // Create an instance of the CWinHttp class DIM pWHttp AS CWinHttpRequest

' // Open an HTTP connection to an HTTP resource pWHttp.Open "GET", "http://forum.qbasic.at/viewtopic.php?t=8996"

' // Send an HTTP request to the HTTP server pWHttp.Send

' // Wait for response with a timeout of 5 seconds DIM iSucceeded AS LONG = pWHttp.WaitForResponse(5)

IF iSucceeded THEN ' // Get the response headers DIM dwsResponseText AS DWSTRING = pWHttp.GetResponseText ' // Extract the version number from the Color Constants title DIM dws AS DWSTRING = DWstrExtract(1, dwsResponseText, "Color Constants v", " [") print "Online Color Constants version is v" & dws END IF

Reference

  • Defined in AfxNova/CWinHttpRequest.inc:327
  • Documented in COM/CWinHttpRequest Class.md
  • Topic: CWinHttpRequest Class