wxWidgets: wxWebResponse Class Reference

| Version: 3.1.5

Loading...
Searching...
No Matches
Public Member Functions | List of all members
wxWebResponse Class Reference
Class List by Category » Networking

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.5-4.x86_64/src/wxWidgets-3.1.5/interface/wx/webrequest.h>`

## Detailed Description

A wxWebResponse allows access to the response sent by the server.

Since
  3.1.5

##

Library: wxNet

<>< =''>:</>&;&;< =''>\ </></>

See also
  wxWebRequest

## Public Member Functions
| wxWebResponse ()
| Default constructor creates an invalid object.
bool | IsOk () const
| Check if the object is valid.
wxString | GetURL () const
| Returns the final URL.
wxString | GetHeader (const wxString &name) const
| Returns a header from the response or an empty string if the header could not be found.
wxFileOffset | GetContentLength () const
| Get the length of returned data if available.
wxString | GetMimeType () const
| Returns the MIME type of the response (if available).
int | GetStatus () const
| Returns the status code returned by the server.
wxString | GetStatusText () const
| Returns the status text of the response.
wxInputStream * | GetStream ()
| Returns a stream which represents the response data sent by the server.
wxString | GetSuggestedFileName () const
| Returns a suggested filename for the response data.
wxString | GetDataFile () const
| Returns the full path of the file to which data is being saved.
wxString | AsString () const
| Returns all response data as a string.

## Constructor & Destructor Documentation

## ◆ wxWebResponse()

wxWebResponse::wxWebResponse | ( |  | ) |

Default constructor creates an invalid object.

Initialize it by assigning wxWebRequest::GetResponse() to it before using it.

See also
  IsOk()

## Member Function Documentation

## ◆ AsString()

wxString wxWebResponse::AsString | ( |  | ) | const

Returns all response data as a string.

This is mostly useful for debugging or diagnostics.

## ◆ GetContentLength()

wxFileOffset wxWebResponse::GetContentLength | ( |  | ) | const

Get the length of returned data if available.

Returns the value specified in the `Content-Length`: response header of `-1` if not available.

## ◆ GetDataFile()

wxString wxWebResponse::GetDataFile | ( |  | ) | const

Returns the full path of the file to which data is being saved.

This is only valid when storage mode is `Storage_File`.

## ◆ GetHeader()

wxString wxWebResponse::GetHeader | ( | const wxString & | name | ) | const

Returns a header from the response or an empty string if the header could not be found.

Parameters

  name | Name of the header field

## ◆ GetMimeType()

wxString wxWebResponse::GetMimeType | ( |  | ) | const

Returns the MIME type of the response (if available).

## ◆ GetStatus()

int wxWebResponse::GetStatus | ( |  | ) | const

Returns the status code returned by the server.

## ◆ GetStatusText()

wxString wxWebResponse::GetStatusText | ( |  | ) | const

Returns the status text of the response.

## ◆ GetStream()

wxInputStream * wxWebResponse::GetStream | ( |  | ) |

Returns a stream which represents the response data sent by the server.

## ◆ GetSuggestedFileName()

wxString wxWebResponse::GetSuggestedFileName | ( |  | ) | const

Returns a suggested filename for the response data.

## ◆ GetURL()

wxString wxWebResponse::GetURL | ( |  | ) | const

Returns the final URL.

This URL might be different than the request URL when a redirection occurred.

## ◆ IsOk()

bool wxWebResponse::IsOk | ( |  | ) | const

Check if the object is valid.

No other methods can be used if this function returns false.