Skip to content

HttpMultiPart

Qt Base Class: QHttpMultiPart

Signature: QHttpMultiPart(self, contentType: PySide6.QtNetwork.QHttpMultiPart.ContentType, parent: Optional[PySide6.QtCore.QObject] = None) -> None QHttpMultiPart(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QHttpMultiPart
PySide6.QtNetwork
QHttpMultiPart(self, contentType: PySide6.QtNetwork.QHttpMultiPart.ContentType, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473572196896["network.HttpMultiPart"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473573794800["QtNetwork.QHttpMultiPart"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473572196896
  140713234304496 --> 1473299815024
  1473573794800 --> 1473572196896
  1473288842240 --> 1473573794800
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QHttpMultiPart

Resembles a MIME multipart message to be sent over HTTP.

Source code in prettyqt\network\httpmultipart.py
class HttpMultiPart(core.ObjectMixin, QtNetwork.QHttpMultiPart):
    """Resembles a MIME multipart message to be sent over HTTP."""

    def __add__(self, other: QtNetwork.QHttpPart):
        self.append(other)
        return self

    def set_content_type(
        self, typ: ContentTypeStr | QtNetwork.QHttpMultiPart.ContentType
    ):
        """Set content type.

        Args:
            typ: content type
        """
        self.setContentType(CONTENT_TYPES.get_enum_value(typ))

    def set_boundary(self, boundary: datatypes.ByteArrayType):
        boundary = datatypes.to_bytearray(boundary)
        self.setBoundary(boundary)

    def get_boundary(self) -> str:
        return self.boundary().data().decode()

set_content_type(typ: ContentTypeStr | QtNetwork.QHttpMultiPart.ContentType)

Set content type.

Parameters:

Name Type Description Default
typ ContentTypeStr | ContentType

content type

required
Source code in prettyqt\network\httpmultipart.py
def set_content_type(
    self, typ: ContentTypeStr | QtNetwork.QHttpMultiPart.ContentType
):
    """Set content type.

    Args:
        typ: content type
    """
    self.setContentType(CONTENT_TYPES.get_enum_value(typ))

⌗ Property table

Qt Property Type Doc
objectName QString