qnetworkrequest.sip 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // qnetworkrequest.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtNetwork Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QNetworkRequest
  22. {
  23. %TypeHeaderCode
  24. #include <qnetworkrequest.h>
  25. %End
  26. public:
  27. enum KnownHeaders
  28. {
  29. ContentTypeHeader,
  30. ContentLengthHeader,
  31. LocationHeader,
  32. LastModifiedHeader,
  33. CookieHeader,
  34. SetCookieHeader,
  35. ContentDispositionHeader,
  36. UserAgentHeader,
  37. ServerHeader,
  38. IfModifiedSinceHeader,
  39. ETagHeader,
  40. IfMatchHeader,
  41. IfNoneMatchHeader,
  42. };
  43. enum Attribute
  44. {
  45. HttpStatusCodeAttribute,
  46. HttpReasonPhraseAttribute,
  47. RedirectionTargetAttribute,
  48. ConnectionEncryptedAttribute,
  49. CacheLoadControlAttribute,
  50. CacheSaveControlAttribute,
  51. SourceIsFromCacheAttribute,
  52. DoNotBufferUploadDataAttribute,
  53. HttpPipeliningAllowedAttribute,
  54. HttpPipeliningWasUsedAttribute,
  55. CustomVerbAttribute,
  56. CookieLoadControlAttribute,
  57. AuthenticationReuseAttribute,
  58. CookieSaveControlAttribute,
  59. BackgroundRequestAttribute,
  60. EmitAllUploadProgressSignalsAttribute,
  61. Http2AllowedAttribute,
  62. Http2WasUsedAttribute,
  63. OriginalContentLengthAttribute,
  64. RedirectPolicyAttribute,
  65. Http2DirectAttribute,
  66. AutoDeleteReplyOnFinishAttribute,
  67. %If (Qt_6_3_0 -)
  68. ConnectionCacheExpiryTimeoutSecondsAttribute,
  69. %End
  70. %If (Qt_6_3_0 -)
  71. Http2CleartextAllowedAttribute,
  72. %End
  73. %If (Qt_6_5_0 -)
  74. UseCredentialsAttribute,
  75. %End
  76. %If (Qt_6_8_0 -)
  77. FullLocalServerNameAttribute,
  78. %End
  79. User,
  80. UserMax,
  81. };
  82. enum CacheLoadControl
  83. {
  84. AlwaysNetwork,
  85. PreferNetwork,
  86. PreferCache,
  87. AlwaysCache,
  88. };
  89. enum LoadControl
  90. {
  91. Automatic,
  92. Manual,
  93. };
  94. enum Priority
  95. {
  96. HighPriority,
  97. NormalPriority,
  98. LowPriority,
  99. };
  100. explicit QNetworkRequest(const QUrl &url);
  101. QNetworkRequest();
  102. QNetworkRequest(const QNetworkRequest &other);
  103. ~QNetworkRequest();
  104. QUrl url() const;
  105. void setUrl(const QUrl &url);
  106. QVariant header(QNetworkRequest::KnownHeaders header) const;
  107. void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value);
  108. %If (Qt_6_7_0 -)
  109. bool hasRawHeader(QAnyStringView headerName) const;
  110. %End
  111. %If (- Qt_6_7_0)
  112. bool hasRawHeader(const QByteArray &headerName) const;
  113. %End
  114. QList<QByteArray> rawHeaderList() const;
  115. %If (Qt_6_7_0 -)
  116. QByteArray rawHeader(QAnyStringView headerName) const;
  117. %End
  118. %If (- Qt_6_7_0)
  119. QByteArray rawHeader(const QByteArray &headerName) const;
  120. %End
  121. void setRawHeader(const QByteArray &headerName, const QByteArray &value);
  122. QVariant attribute(QNetworkRequest::Attribute code, const QVariant &defaultValue = QVariant()) const;
  123. void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
  124. %If (PyQt_SSL)
  125. QSslConfiguration sslConfiguration() const;
  126. %End
  127. %If (PyQt_SSL)
  128. void setSslConfiguration(const QSslConfiguration &configuration);
  129. %End
  130. bool operator==(const QNetworkRequest &other) const;
  131. bool operator!=(const QNetworkRequest &other) const;
  132. void setOriginatingObject(QObject *object /KeepReference/);
  133. QObject *originatingObject() const;
  134. QNetworkRequest::Priority priority() const;
  135. void setPriority(QNetworkRequest::Priority priority);
  136. void swap(QNetworkRequest &other /Constrained/);
  137. int maximumRedirectsAllowed() const;
  138. void setMaximumRedirectsAllowed(int maximumRedirectsAllowed);
  139. enum RedirectPolicy
  140. {
  141. ManualRedirectPolicy,
  142. NoLessSafeRedirectPolicy,
  143. SameOriginRedirectPolicy,
  144. UserVerifiedRedirectPolicy,
  145. };
  146. QString peerVerifyName() const;
  147. void setPeerVerifyName(const QString &peerName);
  148. %If (Qt_6_5_0 -)
  149. QHttp1Configuration http1Configuration() const;
  150. %End
  151. QHttp2Configuration http2Configuration() const;
  152. %If (Qt_6_5_0 -)
  153. void setHttp1Configuration(const QHttp1Configuration &configuration);
  154. %End
  155. void setHttp2Configuration(const QHttp2Configuration &configuration);
  156. enum TransferTimeoutConstant
  157. {
  158. DefaultTransferTimeoutConstant,
  159. };
  160. int transferTimeout() const;
  161. // In Qt v6.7 this was replaced by two overloads but we need the optional keyword argument.
  162. void setTransferTimeout(int timeout = QNetworkRequest::DefaultTransferTimeoutConstant);
  163. %If (Qt_6_2_0 -)
  164. qint64 decompressedSafetyCheckThreshold() const;
  165. %End
  166. %If (Qt_6_2_0 -)
  167. void setDecompressedSafetyCheckThreshold(qint64 threshold);
  168. %End
  169. %If (Qt_6_8_0 -)
  170. QHttpHeaders headers() const;
  171. %End
  172. %If (Qt_6_8_0 -)
  173. void setHeaders(const QHttpHeaders &newHeaders);
  174. %End
  175. %If (Qt_6_11_0 -)
  176. static const std::chrono::milliseconds DefaultTransferTimeout;
  177. %End
  178. %If (Qt_6_11_0 -)
  179. std::chrono::seconds tcpKeepAliveIdleTimeBeforeProbes() const;
  180. %End
  181. %If (Qt_6_11_0 -)
  182. void setTcpKeepAliveIdleTimeBeforeProbes(std::chrono::seconds idle);
  183. %End
  184. %If (Qt_6_11_0 -)
  185. std::chrono::seconds tcpKeepAliveIntervalBetweenProbes() const;
  186. %End
  187. %If (Qt_6_11_0 -)
  188. void setTcpKeepAliveIntervalBetweenProbes(std::chrono::seconds interval);
  189. %End
  190. %If (Qt_6_11_0 -)
  191. int tcpKeepAliveProbeCount() const;
  192. %End
  193. %If (Qt_6_11_0 -)
  194. void setTcpKeepAliveProbeCount(int probes);
  195. %End
  196. };