.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2025 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.html2.WebViewHandlerResponse:
==========================================================================================================================================
|phoenix_title| **wx.html2.WebViewHandlerResponse**
==========================================================================================================================================
A class giving access to various webview response parameters.
Usually a :ref:`wx.html2.WebViewHandler` would set various parameters required for the response like ``HTTP`` status, various headers and must then call :meth:`~wx.html2.WebViewHandlerResponse.Finish` to complete the response or call :meth:`~wx.html2.WebViewHandlerResponse.FinishWithError` to abort the request.
:ref:`wx.html2.WebView`
.. versionadded:: 4.3/wxWidgets-3.3.0
.. seealso:: :meth:`wx.html2.WebViewHandler.StartRequest`
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.html2.WebViewHandlerResponse.FinishWithError` Finishes the request as an error.
:meth:`~wx.html2.WebViewHandlerResponse.SetContentType` Sets the MIME type of the response.
:meth:`~wx.html2.WebViewHandlerResponse.SetHeader` Sets a response header which will be sent to the web view.
:meth:`~wx.html2.WebViewHandlerResponse.SetStatus` Sets the status code of the response.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.html2.WebViewHandlerResponse(object)
A class giving access to various webview response parameters.
.. method:: FinishWithError(self)
Finishes the request as an error.
This will notify that the request could not produce any data.
:rtype: `None`
.. seealso:: :meth:`Finish`
.. method:: SetContentType(self, contentType)
Sets the MIME type of the response.
:param `contentType`: MIME type of the response content
:type `contentType`: string
:rtype: `None`
.. method:: SetHeader(self, name, value)
Sets a response header which will be sent to the web view.
The header will be added if it hasn't been set before or replaced otherwise.
:param `name`: Name of the header
:type `name`: string
:param `value`: String value of the header
:type `value`: string
:rtype: `None`
.. method:: SetStatus(self, status)
Sets the status code of the response.
:param `status`: ``HTTP`` status code
:type `status`: int
:rtype: `None`