docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
NetworkRequest.h
Go to the documentation of this file.
1
///
2
/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3
/// A license is required for commercial use. https://ultralig.ht
4
///
5
#pragma once
6
#include <
Ultralight/Defines.h
>
7
#include <
Ultralight/String.h
>
8
9
namespace
ultralight
{
10
11
///
12
/// @brief Interface for Network requests.
13
///
14
class
UExport
NetworkRequest
{
15
public
:
16
virtual
~NetworkRequest
() { }
17
18
///
19
/// URL of the request.
20
///
21
virtual
String
url
()
const
= 0;
22
23
///
24
/// The host portion of the URL.
25
///
26
virtual
String
urlHost
()
const
= 0;
27
28
///
29
/// The protocol of the URL (eg, "http")
30
///
31
virtual
String
urlProtocol
()
const
= 0;
32
33
///
34
/// The HTTP method (eg, "POST" or "GET")
35
///
36
virtual
String
httpMethod
()
const
= 0;
37
38
///
39
/// The origin of the request.
40
///
41
virtual
String
httpOrigin
()
const
= 0;
42
43
///
44
/// The user-agent of the request.
45
///
46
virtual
String
httpUserAgent
()
const
= 0;
47
48
///
49
/// Enforce additional TLS/SSL certificate validation by verifying the
50
/// server's pinned public key.
51
///
52
/// The public key string can be any number of base64 encoded sha256 hashes
53
/// preceded by "sha256//" and separated by ";".
54
///
55
/// For more info see the cURL docs:
56
/// <https://curl.se/libcurl/c/CURLOPT_PINNEDPUBLICKEY.html>
57
///
58
virtual
void
EnforcePinnedPublicKey
(
const
String
& public_key) = 0;
59
};
60
61
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:22
String.h
Defines.h
ultralight::NetworkRequest
Interface for Network requests.
Definition
NetworkRequest.h:14
ultralight::NetworkRequest::httpMethod
virtual String httpMethod() const =0
The HTTP method (eg, "POST" or "GET").
ultralight::NetworkRequest::EnforcePinnedPublicKey
virtual void EnforcePinnedPublicKey(const String &public_key)=0
Enforce additional TLS/SSL certificate validation by verifying the server's pinned public key.
ultralight::NetworkRequest::urlHost
virtual String urlHost() const =0
The host portion of the URL.
ultralight::NetworkRequest::url
virtual String url() const =0
URL of the request.
ultralight::NetworkRequest::httpOrigin
virtual String httpOrigin() const =0
The origin of the request.
ultralight::NetworkRequest::urlProtocol
virtual String urlProtocol() const =0
The protocol of the URL (eg, "http").
ultralight::NetworkRequest::httpUserAgent
virtual String httpUserAgent() const =0
The user-agent of the request.
ultralight::NetworkRequest::~NetworkRequest
virtual ~NetworkRequest()
Definition
NetworkRequest.h:16
ultralight::String
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition
String.h:31
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
Ultralight
NetworkRequest.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4