• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Web
2
3
4## Overview
5
6This module provides error codes for the exceptions of ArkWeb NDK APIs,
7
8APIs for injecting objects and executing JavaScript code,
9
10APIs for intercepting ArkWeb requests,
11
12and error codes for the ArkWeb network protocol stack.
13
14In addition, ArkWeb capabilities on the native side are also provided, such as refreshing web page, executing JavaScript, and registering callback.
15
16**Since**: 12
17
18
19## Summary
20
21
22### Files
23
24| Name| Description|
25| -------- | -------- |
26| [arkweb_error_code.h](arkweb__error__code_8h.md) | Declares the error codes of the ArkWeb NDK APIs. |
27| [arkweb_interface.h](arkweb__interface_8h.md) | Provides ArkWeb APIs for obtaining native APIs and the basic native API types. |
28| [arkweb_net_error_list.h](arkweb__net__error__list_8h.md) | Declares the error codes of the ArkWeb network protocol stack. |
29| [arkweb_scheme_handler.h](arkweb__scheme__handler_8h.md) | Declares the APIs used to intercept requests from ArkWeb. |
30| [arkweb_type.h](arkweb__type_8h.md) | Defines the common types of ArkWeb on the native side. |
31| [native_interface_arkweb.h](native__interface__arkweb_8h.md) | Declares APIs used to inject objects and execute JavaScript code. |
32
33
34### Structs
35
36| Name| Description|
37| -------- | -------- |
38| struct  [ArkWeb_AnyNativeAPI](_ark_web___any_native_a_p_i.md) | Defines the basic native API types. |
39| struct  [ArkWeb_JavaScriptBridgeData](_ark_web___java_script_bridge_data.md) | Defines the basic structure of JavaScript Bridge data. |
40| struct  [ArkWeb_JavaScriptObject](_ark_web___java_script_object.md) | Defines an injected JavaScript object. |
41| struct  [ArkWeb_ProxyMethod](_ark_web___proxy_method.md) | Defines an injected proxy method. |
42| struct  [ArkWeb_ProxyObject](_ark_web___proxy_object.md) | Defines an injected proxy object. |
43| struct  [ArkWeb_ControllerAPI](_ark_web___controller_a_p_i.md) | Defines a native API struct of the **Web** controller. Before calling the API, you are advised to use **ARKWEB_MEMBER_MISSING** to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM. |
44| struct  [ArkWeb_ComponentAPI](_ark_web___component_a_p_i.md) | Defines a native API struct of the **Web** component. |
45| struct  [ArkWeb_WebMessagePortAPI](_ark_web___web_message_port_a_p_i.md) | Defines a native API struct of the post message. Before calling the API, you are advised to use **ARKWEB_MEMBER_MISSING** to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM. |
46| struct  [ArkWeb_WebMessageAPI](_ark_web___web_message_a_p_i.md) | Defines a native API struct of the post message data. Before calling the API, you are advised to use **ARKWEB_MEMBER_MISSING** to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM. |
47| struct  [ArkWeb_CookieManagerAPI](_ark_web___cookie_manager_a_p_i.md) | Defines a native **CookieManager** API of ArkWeb. Before calling the API, you are advised to use **ARKWEB_MEMBER_MISSING** to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM. |
48
49
50### Macros
51
52| Name| Description|
53| -------- | -------- |
54| [ARKWEB_MEMBER_EXISTS](#arkweb_member_exists)(s, f)    ((intptr_t) & ((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= \*reinterpret_cast<size_t\*>(s)) | Checks whether the member variable exists in the struct. |
55| [ARKWEB_MEMBER_MISSING](#arkweb_member_missing)(s, f)   (\![ARKWEB_MEMBER_EXISTS](#arkweb_member_exists)(s, f) \|\| !((s)->f)) | If the member variable exists in the struct, **false** is returned. Otherwise, **true** is returned. |
56
57
58### Types
59
60| Name| Description|
61| -------- | -------- |
62| typedef enum [ArkWeb_ErrorCode](#arkweb_errorcode) [ArkWeb_ErrorCode](#arkweb_errorcode) | Defines an enum for the error codes of ArkWeb NDK APIs. |
63| typedef enum [ArkWeb_NetError](#arkweb_neterror) [ArkWeb_NetError](#arkweb_neterror) | Defines an enum for the error codes of the ArkWeb network protocol stack. |
64| typedef enum [ArkWeb_CustomSchemeOption](#arkweb_customschemeoption) [ArkWeb_CustomSchemeOption](#arkweb_customschemeoption) | Defines an enum for the custom scheme options. |
65| typedef enum [ArkWeb_ResourceType](#arkweb_resourcetype) [ArkWeb_ResourceType](#arkweb_resourcetype) | Defines an enum for the resource types. |
66| typedef struct ArkWeb_SchemeHandler_ [ArkWeb_SchemeHandler](#arkweb_schemehandler) | Defines a struct for the **SchemeHandler** of a specified scheme. |
67| typedef struct ArkWeb_ResourceHandler_ [ArkWeb_ResourceHandler](#arkweb_resourcehandler) | Defines a struct for the intercepted URL requests. |
68| typedef struct ArkWeb_Response_ [ArkWeb_Response](#arkweb_response) | Defines a struct for **ArkWeb_Response** for the intercepted request. |
69| typedef struct ArkWeb_ResourceRequest_ [ArkWeb_ResourceRequest](#arkweb_resourcerequest) | Defines a struct for resource request. Through **OH_ArkWeb_ResourceRequest**, you can obtain the URL, method, post data, and other information of the request. |
70| typedef struct ArkWeb_RequestHeaderList_ [ArkWeb_RequestHeaderList](#arkweb_requestheaderlist) | Defines a struct for the request header list. |
71| typedef struct ArkWeb_HttpBodyStream_ [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) | Defines a struct for the uploaded data of the request. |
72| typedef void(\* [ArkWeb_OnRequestStart](#arkweb_onrequeststart)) (const [ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler, [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler, bool \*intercept) | Defines a callback used to start the request on the I/O thread. |
73| typedef void(\* [ArkWeb_OnRequestStop](#arkweb_onrequeststop)) (const [ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler, const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Defines a callback used when the request is stopped. |
74| typedef void(\* [ArkWeb_HttpBodyStreamReadCallback](#arkweb_httpbodystreamreadcallback)) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, uint8_t \*buffer, int bytesRead) | Defines a callback used when **OH_ArkWebHttpBodyStream_Read** is complete. |
75| typedef void(\* [ArkWeb_HttpBodyStreamInitCallback](#arkweb_httpbodystreaminitcallback)) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, [ArkWeb_NetError](#arkweb_neterror) result) | Defines a callback used when **ArkWeb_HttpBodyStream** is initialized. |
76| typedef enum [ArkWeb_WebMessageType](#arkweb_webmessagetype) [ArkWeb_WebMessageType](#arkweb_webmessagetype) | Defines an enum for the data types of post message. |
77| typedef struct ArkWeb_WebMessage \* [ArkWeb_WebMessagePtr](#arkweb_webmessageptr) | Defines a struct for the pointer to the data struct of post message. |
78| typedef void(\* [ArkWeb_OnJavaScriptCallback](#arkweb_onjavascriptcallback)) (const char \*webTag, const [ArkWeb_JavaScriptBridgeData](_ark_web___java_script_bridge_data.md) \*data, void \*userData) | Defines a callback used when the injected JavaScript is executed. |
79| typedef void(\* [ArkWeb_OnJavaScriptProxyCallback](#arkweb_onjavascriptproxycallback)) (const char \*webTag, const [ArkWeb_JavaScriptBridgeData](_ark_web___java_script_bridge_data.md) \*dataArray, size_t arraySize, void \*userData) | Defines a callback used when the proxy method is executed. |
80| typedef void(\* [ArkWeb_OnComponentCallback](#arkweb_oncomponentcallback)) (const char \*webTag, void \*userData) | Defines a callback used to return component event notification. |
81| typedef struct ArkWeb_WebMessagePort \* [ArkWeb_WebMessagePortPtr](#arkweb_webmessageportptr) | Defines a struct for the pointer to the message port struct. |
82| typedef void(\* [ArkWeb_OnMessageEventHandler](#arkweb_onmessageeventhandler)) (const char \*webTag, const [ArkWeb_WebMessagePortPtr](#arkweb_webmessageportptr) port, const [ArkWeb_WebMessagePtr](#arkweb_webmessageptr) message, void \*userData) | Defines a callback used to process the post message data sent by the HTML page. |
83| typedef void(\* [NativeArkWeb_OnJavaScriptCallback](#nativearkweb_onjavascriptcallback)) (const char \*) | Defines a callback used to return the result after the JavaScript code is executed. |
84| typedef char \*(\* [NativeArkWeb_OnJavaScriptProxyCallback](#nativearkweb_onjavascriptproxycallback)) (const char \*\*argv, int32_t argc) | Defines a callback of the injected object. |
85| typedef void(\* [NativeArkWeb_OnValidCallback](#nativearkweb_onvalidcallback)) (const char \*) | Defines a callback used when the **Web** component is valid. |
86| typedef void(\* [NativeArkWeb_OnDestroyCallback](#nativearkweb_ondestroycallback)) (const char \*) | Defines a callback used when the **Web** component is destroyed. |
87
88
89### Enums
90
91| Name| Description|
92| -------- | -------- |
93| [ArkWeb_ErrorCode](#arkweb_errorcode) {<br>ARKWEB_SUCCESS = 0, ARKWEB_INIT_ERROR = 17100001, ARKWEB_ERROR_UNKNOWN = 17100100, ARKWEB_INVALID_PARAM = 17100101,<br>ARKWEB_SCHEME_REGISTER_FAILED = 17100102, ARKWEB_INVALID_URL = 17100103, ARKWEB_INVALID_COOKIE_VALUE = 17100104<br>} | Enumerates the error codes of ArkWeb NDK APIs. |
94| [ArkWeb_NativeAPIVariantKind](#arkweb_nativeapivariantkind) {<br/>ARKWEB_NATIVE_COMPONENT, ARKWEB_NATIVE_CONTROLLER, ARKWEB_NATIVE_WEB_MESSAGE_PORT, ARKWEB_NATIVE_WEB_MESSAGE,<br/>ARKWEB_NATIVE_COOKIE_MANAGER<br/>} | Enumerates the native API types. |
95| [ArkWeb_NetError](#arkweb_neterror) {<br>ARKWEB_NET_OK = 0, ARKWEB_ERR_IO_PENDING = -1, ARKWEB_ERR_FAILED = -2, ARKWEB_ERR_ABORTED = -3,<br>ARKWEB_ERR_INVALID_ARGUMENT = -4, ARKWEB_ERR_INVALID_HANDLE = -5, ARKWEB_ERR_FILE_NOT_FOUND = -6, ARKWEB_ERR_TIMED_OUT = -7,<br>ARKWEB_ERR_FILE_TOO_LARGE = -8, ARKWEB_ERR_UNEXPECTED = -9, ARKWEB_ERR_ACCESS_DENIED = -10, ARKWEB_ERR_NOT_IMPLEMENTED = -11,<br>ARKWEB_ERR_INSUFFICIENT_RESOURCES = -12, ARKWEB_ERR_OUT_OF_MEMORY = -13, ARKWEB_ERR_UPLOAD_FILE_CHANGED = -14, ARKWEB_ERR_SOCKET_NOT_CONNECTED = -15,<br>ARKWEB_ERR_FILE_EXISTS = -16, ARKWEB_ERR_FILE_PATH_TOO_LONG = -17, ARKWEB_ERR_FILE_NO_SPACE = -18, ARKWEB_ERR_FILE_VIRUS_INFECTED = -19,<br>ARKWEB_ERR_BLOCKED_BY_CLIENT = -20, ARKWEB_ERR_NETWORK_CHANGED = -21, ARKWEB_ERR_BLOCKED_BY_ADMINISTRATOR = -22, ARKWEB_ERR_SOCKET_CONNECTED = -23,<br>ARKWEB_ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED = -25, ARKWEB_ERR_CONTEXT_SHUT_DOWN = -26, ARKWEB_ERR_BLOCKED_BY_RESPONSE = -27, ARKWEB_ERR_CLEARTEXT_NOT_PERMITTED = -29,<br>ARKWEB_ERR_BLOCKED_BY_CSP = -30, ARKWEB_ERR_H2_OR_QUIC_REQUIRED = -31, ARKWEB_ERR_BLOCKED_BY_ORB = -32, ARKWEB_ERR_CONNECTION_CLOSED = -100,<br>ARKWEB_ERR_CONNECTION_RESET = -101, ARKWEB_ERR_CONNECTION_REFUSED = -102, ARKWEB_ERR_CONNECTION_ABORTED = -103, ARKWEB_ERR_CONNECTION_FAILED = -104,<br>ARKWEB_ERR_NAME_NOT_RESOLVED = -105, ARKWEB_ERR_INTERNET_DISCONNECTED = -106, ARKWEB_ERR_SSL_PROTOCOL_ERROR = -107, ARKWEB_ERR_ADDRESS_INVALID = -108,<br>ARKWEB_ERR_ADDRESS_UNREACHABLE = -109, ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, ARKWEB_ERR_TUNNEL_CONNECTION_FAILED = -111, ARKWEB_ERR_NO_SSL_VERSIONS_ENABLED = -112,<br>ARKWEB_ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, ARKWEB_ERR_SSL_RENEGOTIATION_REQUESTED = -114, ARKWEB_ERR_PROXY_AUTH_UNSUPPORTED = -115, ARKWEB_ERR_BAD_SSL_CLIENT_AUTH_CERT = -117,<br>ARKWEB_ERR_CONNECTION_TIMED_OUT = -118, ARKWEB_ERR_HOST_RESOLVER_QUEUE_TOO_LARGE = -119, ARKWEB_ERR_SOCKS_CONNECTION_FAILED = -120, ARKWEB_ERR_SOCKS_CONNECTION_HOST_UNREACHABLE = -121,<br>ARKWEB_ERR_ALPN_NEGOTIATION_FAILED = -122, ARKWEB_ERR_SSL_NO_RENEGOTIATION = -123, ARKWEB_ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES = -124, ARKWEB_ERR_SSL_DECOMPRESSION_FAILURE_ALERT = -125,<br>ARKWEB_ERR_SSL_BAD_RECORD_MAC_ALERT = -126, ARKWEB_ERR_PROXY_AUTH_REQUESTED = -127, ARKWEB_ERR_PROXY_CONNECTION_FAILED = -130, ARKWEB_ERR_MANDATORY_PROXY_CONFIGURATION_FAILED = -131,<br>ARKWEB_ERR_PRECONNECT_MAX_SOCKET_LIMIT = -133, ARKWEB_ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED = -134, ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY = -135, ARKWEB_ERR_PROXY_CERTIFICATE_INVALID = -136,<br>ARKWEB_ERR_NAME_RESOLUTION_FAILED = -137, ARKWEB_ERR_NETWORK_ACCESS_DENIED = -138, ARKWEB_ERR_TEMPORARILY_THROTTLED = -139, ARKWEB_ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT = -140,<br>ARKWEB_ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED = -141, ARKWEB_ERR_MSG_TOO_BIG = -142, ARKWEB_ERR_WS_PROTOCOL_ERROR = -145, ARKWEB_ERR_ADDRESS_IN_USE = -147,<br>ARKWEB_ERR_SSL_HANDSHAKE_NOT_COMPLETED = -148, ARKWEB_ERR_SSL_BAD_PEER_PUBLIC_KEY = -149, ARKWEB_ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN = -150, ARKWEB_ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED = -151,<br>ARKWEB_ERR_SSL_DECRYPT_ERROR_ALERT = -153, ARKWEB_ERR_WS_THROTTLE_QUEUE_TOO_LARGE = -154, ARKWEB_ERR_SSL_SERVER_CERT_CHANGED = -156, ARKWEB_ERR_SSL_UNRECOGNIZED_NAME_ALERT = -159,<br>ARKWEB_ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR = -160, ARKWEB_ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR = -161, ARKWEB_ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE = -162, ARKWEB_ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE = -163,<br>ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT = -164, ARKWEB_ERR_ICANN_NAME_COLLISION = -166, ARKWEB_ERR_SSL_SERVER_CERT_BAD_FORMAT = -167, ARKWEB_ERR_CT_STH_PARSING_FAILED = -168,<br>ARKWEB_ERR_CT_STH_INCOMPLETE = -169, ARKWEB_ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH = -170, ARKWEB_ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED = -171, ARKWEB_ERR_SSL_OBSOLETE_CIPHER = -172,<br>ARKWEB_ERR_WS_UPGRADE = -173, ARKWEB_ERR_READ_IF_READY_NOT_IMPLEMENTED = -174, ARKWEB_ERR_NO_BUFFER_SPACE = -176, ARKWEB_ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS = -177,<br>ARKWEB_ERR_EARLY_DATA_REJECTED = -178, ARKWEB_ERR_WRONG_VERSION_ON_EARLY_DATA = -179, ARKWEB_ERR_TLS13_DOWNGRADE_DETECTED = -180, ARKWEB_ERR_SSL_KEY_USAGE_INCOMPATIBLE = -181,<br>ARKWEB_ERR_INVALID_ECH_CONFIG_LIST = -182, ARKWEB_ERR_ECH_NOT_NEGOTIATED = -183, ARKWEB_ERR_ECH_FALLBACK_CERTIFICATE_INVALID = -184, ARKWEB_ERR_CERT_COMMON_NAME_INVALID = -200,<br>ARKWEB_ERR_CERT_DATE_INVALID = -201, ARKWEB_ERR_CERT_AUTHORITY_INVALID = -202, ARKWEB_ERR_CERT_CONTAINS_ERRORS = -203, ARKWEB_ERR_CERT_NO_REVOCATION_MECHANISM = -204,<br>ARKWEB_ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, ARKWEB_ERR_CERT_REVOKED = -206, ARKWEB_ERR_CERT_INVALID = -207, ARKWEB_ERR_CERT_WEAK_SIGNATURE_ALGORITHM = -208,<br>ARKWEB_ERR_CERT_NON_UNIQUE_NAME = -210, ARKWEB_ERR_CERT_WEAK_KEY = -211, ARKWEB_ERR_CERT_NAME_CONSTRAINT_VIOLATION = -212, ARKWEB_ERR_CERT_VALIDITY_TOO_LONG = -213,<br>ARKWEB_ERR_CERTIFICATE_TRANSPARENCY_REQUIRED = -214, ARKWEB_ERR_CERT_SYMANTEC_LEGACY = -215, ARKWEB_ERR_CERT_KNOWN_INTERCEPTION_BLOCKED = -217, ARKWEB_ERR_SSL_OBSOLETE_VERSION_OR_CIPHER = -218,<br>ARKWEB_ERR_CERT_END = -219, ARKWEB_ERR_INVALID_URL = -300, ARKWEB_ERR_DISALLOWED_URL_SCHEME = -301, ARKWEB_ERR_UNKNOWN_URL_SCHEME = -302,<br>ARKWEB_ERR_INVALID_REDIRECT = -303, ARKWEB_ERR_TOO_MANY_REDIRECTS = -310, ARKWEB_ERR_UNSAFE_REDIRECT = -311, ARKWEB_ERR_UNSAFE_PORT = -312,<br>ARKWEB_ERR_INVALID_RESPONSE = -320, ARKWEB_ERR_INVALID_CHUNKED_ENCODING = -321, ARKWEB_ERR_METHOD_UNSUPPORTED = -322, ARKWEB_ERR_UNEXPECTED_PROXY_AUTH = -323,<br>ARKWEB_ERR_EMPTY_RESPONSE = -324, ARKWEB_ERR_RESPONSE_HEADERS_TOO_BIG = -325, ARKWEB_ERR_PAC_SCRIPT_FAILED = -327, ARKWEB_ERR_REQUEST_RANGE_NOT_SATISFIABLE = -328,<br>ARKWEB_ERR_MALFORMED_IDENTITY = -329, ARKWEB_ERR_CONTENT_DECODING_FAILED = -330, ARKWEB_ERR_NETWORK_IO_SUSPENDED = -331, ARKWEB_ERR_SYN_REPLY_NOT_RECEIVED = -332,<br>ARKWEB_ERR_ENCODING_CONVERSION_FAILED = -333, ARKWEB_ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT = -334, ARKWEB_ERR_NO_SUPPORTED_PROXIES = -336, ARKWEB_ERR_HTTP2_PROTOCOL_ERROR = -337,<br>ARKWEB_ERR_INVALID_AUTH_CREDENTIALS = -338, ARKWEB_ERR_UNSUPPORTED_AUTH_SCHEME = -339, ARKWEB_ERR_ENCODING_DETECTION_FAILED = -340, ARKWEB_ERR_MISSING_AUTH_CREDENTIALS = -341,<br>ARKWEB_ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS = -342, ARKWEB_ERR_MISCONFIGURED_AUTH_ENVIRONMENT = -343, ARKWEB_ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS = -344, ARKWEB_ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN = -345,<br>ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH = -346, ARKWEB_ERR_INCOMPLETE_HTTP2_HEADERS = -347, ARKWEB_ERR_PAC_NOT_IN_DHCP = -348, ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION = -349,<br>ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION = -350, ARKWEB_ERR_HTTP2_SERVER_REFUSED_STREAM = -351, ARKWEB_ERR_HTTP2_PING_FAILED = -352, ARKWEB_ERR_CONTENT_LENGTH_MISMATCH = -354,<br>ARKWEB_ERR_INCOMPLETE_CHUNKED_ENCODING = -355, ARKWEB_ERR_QUIC_PROTOCOL_ERROR = -356, ARKWEB_ERR_RESPONSE_HEADERS_TRUNCATED = -357, ARKWEB_ERR_QUIC_HANDSHAKE_FAILED = -358,<br>ARKWEB_ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY = -360, ARKWEB_ERR_HTTP2_FLOW_CONTROL_ERROR = -361, ARKWEB_ERR_HTTP2_FRAME_SIZE_ERROR = -362, ARKWEB_ERR_HTTP2_COMPRESSION_ERROR = -363,<br>ARKWEB_ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION = -364, ARKWEB_ERR_HTTP_1_1_REQUIRED = -365, ARKWEB_ERR_PROXY_HTTP_1_1_REQUIRED = -366, ARKWEB_ERR_PAC_SCRIPT_TERMINATED = -367,<br>ARKWEB_ERR_INVALID_HTTP_RESPONSE = -370, ARKWEB_ERR_CONTENT_DECODING_INIT_FAILED = -371, ARKWEB_ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED = -372, ARKWEB_ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE = -373,<br>ARKWEB_ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER = -374, ARKWEB_ERR_TOO_MANY_RETRIES = -375, ARKWEB_ERR_HTTP2_STREAM_CLOSED = -376, ARKWEB_ERR_HTTP2_CLIENT_REFUSED_STREAM = -377,<br>ARKWEB_ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH = -378, ARKWEB_ERR_HTTP_RESPONSE_CODE_FAILURE = -379, ARKWEB_ERR_QUIC_UNKNOWN_CERT_ROOT = -380, ARKWEB_ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED = -381,<br>ARKWEB_ERR_TOO_MANY_ACCEPT_CH_RESTARTS = -382, ARKWEB_ERR_INCONSISTENT_IP_ADDRESS_SPACE = -383, ARKWEB_ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY = -384, ARKWEB_ERR_CACHE_MISS = -400,<br>ARKWEB_ERR_CACHE_READ_FAILURE = -401, ARKWEB_ERR_CACHE_WRITE_FAILURE = -402, ARKWEB_ERR_CACHE_OPERATION_UNSUPPORTED = -403, ARKWEB_ERR_CACHE_OPEN_FAILURE = -404,<br>ARKWEB_ERR_CACHE_CREATE_FAILURE = -405, ARKWEB_ERR_CACHE_RACE = -406, ARKWEB_ERR_CACHE_CHECKSUM_READ_FAILURE = -407, ARKWEB_ERR_CACHE_CHECKSUM_MISMATCH = -408,<br>ARKWEB_ERR_CACHE_LOCK_TIMEOUT = -409, ARKWEB_ERR_CACHE_AUTH_FAILURE_AFTER_READ = -410, ARKWEB_ERR_CACHE_ENTRY_NOT_SUITABLE = -411, ARKWEB_ERR_CACHE_DOOM_FAILURE = -412,<br>ARKWEB_ERR_CACHE_OPEN_OR_CREATE_FAILURE = -413, ARKWEB_ERR_INSECURE_RESPONSE = -501, ARKWEB_ERR_NO_PRIVATE_KEY_FOR_CERT = -502, ARKWEB_ERR_ADD_USER_CERT_FAILED = -503,<br>ARKWEB_ERR_INVALID_SIGNED_EXCHANGE = -504, ARKWEB_ERR_INVALID_WEB_BUNDLE = -505, ARKWEB_ERR_TRUST_TOKEN_OPERATION_FAILED = -506, ARKWEB_ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST = -507,<br>ARKWEB_ERR_FTP_FAILED = -601, ARKWEB_ERR_FTP_SERVICE_UNAVAILABLE = -602, ARKWEB_ERR_FTP_TRANSFER_ABORTED = -603, ARKWEB_ERR_FTP_FILE_BUSY = -604,<br>ARKWEB_ERR_FTP_SYNTAX_ERROR = -605, ARKWEB_ERR_FTP_COMMAND_UNSUPPORTED = -606, ARKWEB_ERR_FTP_BAD_COMMAND_SEQUENCE = -607, ARKWEB_ERR_PKCS12_IMPORT_BAD_PASSWORD = -701,<br>ARKWEB_ERR_PKCS12_IMPORT_FAILED = -702, ARKWEB_ERR_IMPORT_CA_CERT_NOT_CA = -703, ARKWEB_ERR_IMPORT_CERT_ALREADY_EXISTS = -704, ARKWEB_ERR_IMPORT_CA_CERT_FAILED = -705,<br>ARKWEB_ERR_IMPORT_SERVER_CERT_FAILED = -706, ARKWEB_ERR_PKCS12_IMPORT_INVALID_MAC = -707, ARKWEB_ERR_PKCS12_IMPORT_INVALID_FILE = -708, ARKWEB_ERR_PKCS12_IMPORT_UNSUPPORTED = -709,<br>ARKWEB_ERR_KEY_GENERATION_FAILED = -710, ARKWEB_ERR_PRIVATE_KEY_EXPORT_FAILED = -712, ARKWEB_ERR_SELF_SIGNED_CERT_GENERATION_FAILED = -713, ARKWEB_ERR_CERT_DATABASE_CHANGED = -714,<br>ARKWEB_ERR_CERT_VERIFIER_CHANGED = -716, ARKWEB_ERR_DNS_MALFORMED_RESPONSE = -800, ARKWEB_ERR_DNS_SERVER_REQUIRES_TCP = -801, ARKWEB_ERR_DNS_SERVER_FAILED = -802,<br>ARKWEB_ERR_DNS_TIMED_OUT = -803, ARKWEB_ERR_DNS_CACHE_MISS = -804, ARKWEB_ERR_DNS_SEARCH_EMPTY = -805, ARKWEB_ERR_DNS_SORT_ERROR = -806,<br>ARKWEB_ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED = -808, ARKWEB_ERR_DNS_NAME_HTTPS_ONLY = -809, ARKWEB_ERR_DNS_REQUEST_CANCELED = -810, ARKWEB_ERR_DNS_NO_MATCHING_SUPPORTED_ALPN = -811<br>} | Enumerates the error codes of the ArkWeb network protocol stack. |
96| [ArkWeb_CustomSchemeOption](#arkweb_customschemeoption) {<br>**OH_ARKWEB_SCHEME_OPTION_NONE** = 0, ARKWEB_SCHEME_OPTION_STANDARD = 1 &lt;&lt; 0, ARKWEB_SCHEME_OPTION_LOCAL = 1 &lt;&lt; 1, ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED = 1 &lt;&lt; 2,<br>ARKWEB_SCHEME_OPTION_SECURE = 1 &lt;&lt; 3, ARKWEB_SCHEME_OPTION_CORS_ENABLED = 1 &lt;&lt; 4, ARKWEB_SCHEME_OPTION_CSP_BYPASSING = 1 &lt;&lt; 5, ARKWEB_SCHEME_OPTION_FETCH_ENABLED = 1 &lt;&lt; 6,<br>ARKWEB_SCHEME_OPTION_CODE_CACHE_ENABLED = 1 &lt;&lt; 7<br>} | Enumerates the custom scheme options. |
97| [ArkWeb_ResourceType](#arkweb_resourcetype) {<br>MAIN_FRAME = 0, SUB_FRAME = 1, STYLE_SHEET = 2, SCRIPT = 3,<br>IMAGE = 4, FONT_RESOURCE = 5, SUB_RESOURCE = 6, OBJECT = 7,<br>MEDIA = 8, WORKER = 9, SHARED_WORKER = 10, PREFETCH = 11,<br>FAVICON = 12, XHR = 13, PING = 14, SERVICE_WORKER = 15,<br>CSP_REPORT = 16, PLUGIN_RESOURCE = 17, NAVIGATION_PRELOAD_MAIN_FRAME = 19, NAVIGATION_PRELOAD_SUB_FRAME = 20<br>} | Enumerates the resource types. |
98| [ArkWeb_WebMessageType](#arkweb_webmessagetype) { ARKWEB_NONE = 0, ARKWEB_STRING, ARKWEB_BUFFER } | Enumerates the data types of post message. |
99
100### Functions
101
102| Name| Description|
103| -------- | -------- |
104| [ArkWeb_AnyNativeAPI](_ark_web___any_native_a_p_i.md) \* [OH_ArkWeb_GetNativeAPI](#oh_arkweb_getnativeapi) ([ArkWeb_NativeAPIVariantKind](#arkweb_nativeapivariantkind) type) | Obtains the native API struct based on the transferred API type. |
105| void [OH_ArkWebRequestHeaderList_Destroy](#oh_arkwebrequestheaderlist_destroy) ([ArkWeb_RequestHeaderList](#arkweb_requestheaderlist) \*requestHeaderList) | Destroys an **ArkWeb_RequestHeaderList** object. |
106| int32_t [OH_ArkWebRequestHeaderList_GetSize](#oh_arkwebrequestheaderlist_getsize) (const [ArkWeb_RequestHeaderList](#arkweb_requestheaderlist) \*requestHeaderList) | Obtains the size of a request header list. |
107| void [OH_ArkWebRequestHeaderList_GetHeader](#oh_arkwebrequestheaderlist_getheader) (const [ArkWeb_RequestHeaderList](#arkweb_requestheaderlist) \*requestHeaderList, int32_t index, char \*\*key, char \*\*value) | Obtains a specified request header. |
108| int32_t [OH_ArkWebResourceRequest_SetUserData](#oh_arkwebresourcerequest_setuserdata) ([ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, void \*userData) | Sets user data to the **ArkWeb_ResourceRequest** object. |
109| void \* [OH_ArkWebResourceRequest_GetUserData](#oh_arkwebresourcerequest_getuserdata) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Obtains user data from **ArkWeb_ResourceRequest**. |
110| void [OH_ArkWebResourceRequest_GetMethod](#oh_arkwebresourcerequest_getmethod) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, char \*\*method) | Obtains the method of a request. |
111| void [OH_ArkWebResourceRequest_GetUrl](#oh_arkwebresourcerequest_geturl) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, char \*\*url) | Obtains the URL of a request. |
112| void [OH_ArkWebResourceRequest_GetHttpBodyStream](#oh_arkwebresourcerequest_gethttpbodystream) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*\*httpBodyStream) | Creates an **ArkWeb_HttpBodyStream** to read the uploaded data of the request. |
113| void [OH_ArkWebResourceRequest_DestroyHttpBodyStream](#oh_arkwebresourcerequest_destroyhttpbodystream) ([ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Destroys an **ArkWeb_HttpBodyStream** object. |
114| int32_t [OH_ArkWebResourceRequest_GetResourceType](#oh_arkwebresourcerequest_getresourcetype) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Obtains the resource type of a request. |
115| void [OH_ArkWebResourceRequest_GetFrameUrl](#oh_arkwebresourcerequest_getframeurl) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, char \*\*frameUrl) | Obtains the URL of the frame that triggers the request. |
116| int32_t [OH_ArkWebHttpBodyStream_SetUserData](#oh_arkwebhttpbodystream_setuserdata) ([ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, void \*userData) | Sets user data to the **ArkWeb_HttpBodyStream** object. |
117| void \* [OH_ArkWebHttpBodyStream_GetUserData](#oh_arkwebhttpbodystream_getuserdata) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Obtains user data from **ArkWeb_HttpBodyStream**. |
118| int32_t [OH_ArkWebHttpBodyStream_SetReadCallback](#oh_arkwebhttpbodystream_setreadcallback) ([ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, [ArkWeb_HttpBodyStreamReadCallback](#arkweb_httpbodystreamreadcallback) readCallback) | Sets a callback for **OH_ArkWebHttpBodyStream_Read**. |
119| int32_t [OH_ArkWebHttpBodyStream_Init](#oh_arkwebhttpbodystream_init) ([ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, [ArkWeb_HttpBodyStreamInitCallback](#arkweb_httpbodystreaminitcallback) initCallback) | Initializes **ArkWeb_HttpBodyStream**. |
120| void [OH_ArkWebHttpBodyStream_Read](#oh_arkwebhttpbodystream_read) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream, uint8_t \*buffer, int bufLen) | Exports upload data of the request to the buffer. |
121| uint64_t [OH_ArkWebHttpBodyStream_GetSize](#oh_arkwebhttpbodystream_getsize) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Obtains the size of **httpBodyStream**. |
122| uint64_t [OH_ArkWebHttpBodyStream_GetPosition](#oh_arkwebhttpbodystream_getposition) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Obtains the position of **httpBodyStream**. |
123| bool [OH_ArkWebHttpBodyStream_IsChunked](#oh_arkwebhttpbodystream_ischunked) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Determines whether **httpBodyStream** is chunked to transfer. |
124| bool [OH_ArkWebHttpBodyStream_IsEof](#oh_arkwebhttpbodystream_iseof) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Returns **true** if all data in **httpBodyStream** is read. |
125| bool [OH_ArkWebHttpBodyStream_IsInMemory](#oh_arkwebhttpbodystream_isinmemory) (const [ArkWeb_HttpBodyStream](#arkweb_httpbodystream) \*httpBodyStream) | Returns **true** if all the uploaded data in **httpBodyStream** is in memory and all read requests will be synchronized successfully. |
126| int32_t [OH_ArkWebResourceRequest_Destroy](#oh_arkwebresourcerequest_destroy) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Destroys an **ArkWeb_ResourceRequest** object. |
127| void [OH_ArkWebResourceRequest_GetReferrer](#oh_arkwebresourcerequest_getreferrer) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, char \*\*referrer) | Obtains the **Referrer** of a request. |
128| void [OH_ArkWebResourceRequest_GetRequestHeaders](#oh_arkwebresourcerequest_getrequestheaders) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest, [ArkWeb_RequestHeaderList](#arkweb_requestheaderlist) \*\*requestHeaderList) | Obtains the **OH_ArkWeb_RequestHeaderList** of a request. |
129| bool [OH_ArkWebResourceRequest_IsRedirect](#oh_arkwebresourcerequest_isredirect) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Determines whether a request is redirect. |
130| bool [OH_ArkWebResourceRequest_IsMainFrame](#oh_arkwebresourcerequest_ismainframe) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Determines whether a request is from the main frame. |
131| bool [OH_ArkWebResourceRequest_HasGesture](#oh_arkwebresourcerequest_hasgesture) (const [ArkWeb_ResourceRequest](#arkweb_resourcerequest) \*resourceRequest) | Determines whether a request is triggered by the user gesture. |
132| int32_t [OH_ArkWeb_RegisterCustomSchemes](#oh_arkweb_registercustomschemes) (const char \*scheme, int32_t option) | Registers a custom scheme with the **ArkWeb**. |
133| bool [OH_ArkWebServiceWorker_SetSchemeHandler](#oh_arkwebserviceworker_setschemehandler) (const char \*scheme, [ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler) | Sets an **ArkWeb_SchemeHandler** for a specified scheme to intercept requests of this scheme triggered by **ServiceWorker**. |
134| bool [OH_ArkWeb_SetSchemeHandler](#oh_arkweb_setschemehandler) (const char \*scheme, const char \*webTag, [ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler) | Sets an **ArkWeb_SchemeHandler** for a specified scheme to intercept requests of this scheme. |
135| int32_t [OH_ArkWebServiceWorker_ClearSchemeHandlers](#oh_arkwebserviceworker_clearschemehandlers) () | Clears the **SchemeHandler** registered for **ServiceWorker**. |
136| int32_t [OH_ArkWeb_ClearSchemeHandlers](#oh_arkweb_clearschemehandlers) (const char \*webTag) | Clears the **SchemeHandler** registered for the specified web. |
137| void [OH_ArkWeb_CreateSchemeHandler](#oh_arkweb_createschemehandler) ([ArkWeb_SchemeHandler](#arkweb_schemehandler) \*\*schemeHandler) | Creates an **ArkWeb_SchemeHandler** object. |
138| void [OH_ArkWeb_DestroySchemeHandler](#oh_arkweb_destroyschemehandler) ([ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler) | Destroys an **ArkWeb_SchemeHandler** object. |
139| int32_t [OH_ArkWebSchemeHandler_SetUserData](#oh_arkwebschemehandler_setuserdata) ([ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler, void \*userData) | Sets a user data to the **ArkWeb_SchemeHandler** object. |
140| void \* [OH_ArkWebSchemeHandler_GetUserData](#oh_arkwebschemehandler_getuserdata) (const [ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler) | Obtains the user data from **ArkWeb_SchemeHandler**. |
141| int32_t [OH_ArkWebSchemeHandler_SetOnRequestStart](#oh_arkwebschemehandler_setonrequeststart) ([ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler, [ArkWeb_OnRequestStart](#arkweb_onrequeststart) onRequestStart) | Sets an **OnRequestStart** callback for **SchemeHandler**. |
142| int32_t [OH_ArkWebSchemeHandler_SetOnRequestStop](#oh_arkwebschemehandler_setonrequeststop) ([ArkWeb_SchemeHandler](#arkweb_schemehandler) \*schemeHandler, [ArkWeb_OnRequestStop](#arkweb_onrequeststop) onRequestStop) | Sets an **OnRequestStop** callback for **SchemeHandler**. |
143| void [OH_ArkWeb_CreateResponse](#oh_arkweb_createresponse) ([ArkWeb_Response](#arkweb_response) \*\*response) | Creates an **ArkWeb_Response** object for the intercepted request. |
144| void [OH_ArkWeb_DestroyResponse](#oh_arkweb_destroyresponse) ([ArkWeb_Response](#arkweb_response) \*response) | Destroys an **ArkWeb_Response** object. |
145| int32_t [OH_ArkWebResponse_SetUrl](#oh_arkwebresponse_seturl) ([ArkWeb_Response](#arkweb_response) \*response, const char \*url) | Sets the parsed URL that is redirected or changed due to HSTS. After the setting, redirection is triggered. |
146| void [OH_ArkWebResponse_GetUrl](#oh_arkwebresponse_geturl) (const [ArkWeb_Response](#arkweb_response) \*response, char \*\*url) | Obtains the parsed URL that is redirected or changed due to HSTS. |
147| int32_t [OH_ArkWebResponse_SetError](#oh_arkwebresponse_seterror) ([ArkWeb_Response](#arkweb_response) \*response, [ArkWeb_NetError](#arkweb_neterror) errorCode) | Sets an error code for the **ArkWeb_Response** object. |
148| [ArkWeb_NetError](#arkweb_neterror) [OH_ArkWebResponse_GetError](#oh_arkwebresponse_geterror) (const [ArkWeb_Response](#arkweb_response) \*response) | Obtains the error code of **ArkWeb_Response**. |
149| int32_t [OH_ArkWebResponse_SetStatus](#oh_arkwebresponse_setstatus) ([ArkWeb_Response](#arkweb_response) \*response, int status) | Sets an HTTP status code for the **ArkWeb_Response** object. |
150| int [OH_ArkWebResponse_GetStatus](#oh_arkwebresponse_getstatus) (const [ArkWeb_Response](#arkweb_response) \*response) | Obtains the HTTP status code of **ArkWeb_Response**. |
151| int32_t [OH_ArkWebResponse_SetStatusText](#oh_arkwebresponse_setstatustext) ([ArkWeb_Response](#arkweb_response) \*response, const char \*statusText) | Sets the status text for **ArkWeb_Response**. |
152| void [OH_ArkWebResponse_GetStatusText](#oh_arkwebresponse_getstatustext) (const [ArkWeb_Response](#arkweb_response) \*response, char \*\*statusText) | Obtains the status text of **ArkWeb_Response**. |
153| int32_t [OH_ArkWebResponse_SetMimeType](#oh_arkwebresponse_setmimetype) ([ArkWeb_Response](#arkweb_response) \*response, const char \*mimeType) | Sets the mime type for **ArkWeb_Response**. |
154| void [OH_ArkWebResponse_GetMimeType](#oh_arkwebresponse_getmimetype) (const [ArkWeb_Response](#arkweb_response) \*response, char \*\*mimeType) | Obtains the mime type of **ArkWeb_Response**. |
155| int32_t [OH_ArkWebResponse_SetCharset](#oh_arkwebresponse_setcharset) ([ArkWeb_Response](#arkweb_response) \*response, const char \*charset) | Sets the character set for **ArkWeb_Response**. |
156| void [OH_ArkWebResponse_GetCharset](#oh_arkwebresponse_getcharset) (const [ArkWeb_Response](#arkweb_response) \*response, char \*\*charset) | Obtains the character set of **ArkWeb_Response**. |
157| int32_t [OH_ArkWebResponse_SetHeaderByName](#oh_arkwebresponse_setheaderbyname) ([ArkWeb_Response](#arkweb_response) \*response, const char \*name, const char \*value, bool overwrite) | Sets a header for **ArkWeb_Response**. |
158| void [OH_ArkWebResponse_GetHeaderByName](#oh_arkwebresponse_getheaderbyname) (const [ArkWeb_Response](#arkweb_response) \*response, const char \*name, char \*\*value) | Obtains the header from **ArkWeb_Response**. |
159| int32_t [OH_ArkWebResourceHandler_Destroy](#oh_arkwebresourcehandler_destroy) (const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler) | Destroys an **ArkWeb_ResourceHandler** object. |
160| int32_t [OH_ArkWebResourceHandler_DidReceiveResponse](#oh_arkwebresourcehandler_didreceiveresponse) (const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler, const [ArkWeb_Response](#arkweb_response) \*response) | Sends a response header for the intercepted request. |
161| int32_t [OH_ArkWebResourceHandler_DidReceiveData](#oh_arkwebresourcehandler_didreceivedata) (const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler, const uint8_t \*buffer, int64_t bufLen) | Sends a response body to the intercepted request. |
162| int32_t [OH_ArkWebResourceHandler_DidFinish](#oh_arkwebresourcehandler_didfinish) (const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler) | Notifies the ArkWeb kernel that the request is intercepted and that no more data is available. |
163| int32_t [OH_ArkWebResourceHandler_DidFailWithError](#oh_arkwebresourcehandler_didfailwitherror) (const [ArkWeb_ResourceHandler](#arkweb_resourcehandler) \*resourceHandler, [ArkWeb_NetError](#arkweb_neterror) errorCode) | Notifies the ArkWeb kernel that the intercepted request fails. |
164| void [OH_ArkWeb_ReleaseString](#oh_arkweb_releasestring) (char \*string) | Releases the string created by NDK APIs. |
165| void [OH_ArkWeb_ReleaseByteArray](#oh_arkweb_releasebytearray) (uint8_t \*byteArray) | Releases the byte array created by NDK APIs. |
166| void [OH_NativeArkWeb_RunJavaScript](#oh_nativearkweb_runjavascript) (const char \*webTag, const char \*jsCode, [NativeArkWeb_OnJavaScriptCallback](#nativearkweb_onjavascriptcallback) callback) | Runs a piece of JavaScript code in the displaying page. |
167| void [OH_NativeArkWeb_RegisterJavaScriptProxy](#oh_nativearkweb_registerjavascriptproxy) (const char \*webTag, const char \*objName, const char \*\*methodList, [NativeArkWeb_OnJavaScriptProxyCallback](#nativearkweb_onjavascriptproxycallback) \*callback, int32_t size, bool needRefresh) | Lists the registered objects and function names. |
168| void [OH_NativeArkWeb_UnregisterJavaScriptProxy](#oh_nativearkweb_unregisterjavascriptproxy) (const char \*webTag, const char \*objName) | Deletes a registered object and its callback. |
169| void [OH_NativeArkWeb_SetJavaScriptProxyValidCallback](#oh_nativearkweb_setjavascriptproxyvalidcallback) (const char \*webTag, [NativeArkWeb_OnValidCallback](#nativearkweb_onvalidcallback) callback) | Sets a callback used when an object is valid. |
170| [NativeArkWeb_OnValidCallback](#nativearkweb_onvalidcallback) [OH_NativeArkWeb_GetJavaScriptProxyValidCallback](#oh_nativearkweb_getjavascriptproxyvalidcallback) (const char \*webTag) | Obtains the callback used when a registered object is valid. |
171| void [OH_NativeArkWeb_SetDestroyCallback](#oh_nativearkweb_setdestroycallback) (const char \*webTag, [NativeArkWeb_OnDestroyCallback](#nativearkweb_ondestroycallback) callback) | Sets a callback used when a component is destroyed. |
172| [NativeArkWeb_OnDestroyCallback](#nativearkweb_ondestroycallback) [OH_NativeArkWeb_GetDestroyCallback](#oh_nativearkweb_getdestroycallback) (const char \*webTag) | Obtains the callback used when a registered component is destroyed. |
173| [ArkWeb_ErrorCode](#arkweb_errorcode) [OH_NativeArkWeb_LoadData](#oh_nativearkweb_loaddata) (const char* webTag,const char* data,const char* mimeType,const char* encoding,const char* baseUrl,const char* historyUrl) | Loads data or URLs. This function must be called in the main thread. |
174
175
176## Macro Description
177
178
179### ARKWEB_MEMBER_EXISTS
180
181```
182#define ARKWEB_MEMBER_EXISTS( s,  f )    ((intptr_t) & ((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= *reinterpret_cast<size_t*>(s))
183```
184**Description**
185
186Checks whether the member variable exists in the struct.
187
188**Since**: 12
189
190
191### ARKWEB_MEMBER_MISSING
192
193```
194#define ARKWEB_MEMBER_MISSING( s,  f )   (!ARKWEB_MEMBER_EXISTS(s, f) || !((s)->f))
195```
196**Description**
197
198If the member variable exists in the struct, **false** is returned. Otherwise, **true** is returned.
199
200**Since**: 12
201
202## Type Description
203
204
205### ArkWeb_CustomSchemeOption
206
207```
208typedef enum ArkWeb_CustomSchemeOption ArkWeb_CustomSchemeOption
209```
210**Description**
211
212Defines an enum for the custom scheme options.
213
214**System capability**: SystemCapability.Web.Webview.Core
215
216**Since**: 12
217
218
219### ArkWeb_ErrorCode
220
221```
222typedef enum ArkWeb_ErrorCode ArkWeb_ErrorCode
223```
224**Description**
225
226Defines an enum for the error codes of ArkWeb NDK APIs.
227
228**System capability**: SystemCapability.Web.Webview.Core
229
230**Since**: 12
231
232
233### ArkWeb_HttpBodyStream
234
235```
236typedef struct ArkWeb_HttpBodyStream_ ArkWeb_HttpBodyStream
237```
238**Description**
239
240Defines a struct for the uploaded data of the request.
241
242Use the **OH_ArkWebHttpBodyStream_\*** API to read the uploaded data.
243
244**System capability**: SystemCapability.Web.Webview.Core
245
246**Since**: 12
247
248
249### ArkWeb_HttpBodyStreamInitCallback
250
251```
252typedef void(* ArkWeb_HttpBodyStreamInitCallback) (const ArkWeb_HttpBodyStream *httpBodyStream, ArkWeb_NetError result)
253```
254**Description**
255
256Defines a callback used when **ArkWeb_HttpBodyStream** is initialized.
257
258**System capability**: SystemCapability.Web.Webview.Core
259
260**Since**: 12
261
262**Parameters**
263
264| Name| Description|
265| -------- | -------- |
266| httpBodyStream | ArkWeb_HttpBodyStream. |
267| result | If the operation is successful, **ARKWEB_NET_OK** is returned. Otherwise, see [arkweb_net_error_list.h](arkweb__net__error__list_8h.md).|
268
269
270### ArkWeb_HttpBodyStreamReadCallback
271
272```
273typedef void(* ArkWeb_HttpBodyStreamReadCallback) (const ArkWeb_HttpBodyStream *httpBodyStream, uint8_t *buffer, int bytesRead)
274```
275**Description**
276
277Defines a callback used when **OH_ArkWebHttpBodyStream_Read** is complete.
278
279**System capability**: SystemCapability.Web.Webview.Core
280
281**Since**: 12
282
283**Parameters**
284
285| Name| Description|
286| -------- | -------- |
287| httpBodyStream | ArkWeb_HttpBodyStream. |
288| buffer | Buffer for receiving data. |
289| bytesRead | Callback used when **OH_ArkWebHttpBodyStream_Read** is complete. If the value of **bytesRead** is greater than 0, the **buffer** is filled with data of the **bytesRead** size. The caller can read data from the **buffer**. If **OH_ArkWebHttpBodyStream_IsEOF** is false, the caller can continue to read the data left.|
290
291
292### ArkWeb_NetError
293
294```
295typedef enum ArkWeb_NetError ArkWeb_NetError
296```
297**Description**
298
299Defines an enum for the error codes of the ArkWeb network protocol stack.
300
301**System capability**: SystemCapability.Web.Webview.Core
302
303**Since**: 12
304
305
306### ArkWeb_OnComponentCallback
307
308```
309typedef void(* ArkWeb_OnComponentCallback) (const char *webTag, void *userData)
310```
311**Description**
312
313Defines a callback used to return component event notification.
314
315**Since**: 12
316
317
318### ArkWeb_OnJavaScriptCallback
319
320```
321typedef void(* ArkWeb_OnJavaScriptCallback) (const char *webTag, const ArkWeb_JavaScriptBridgeData *data, void *userData)
322```
323**Description**
324
325Defines a callback used when the injected JavaScript is executed.
326
327**Since**: 12
328
329
330### ArkWeb_OnJavaScriptProxyCallback
331
332```
333typedef void(* ArkWeb_OnJavaScriptProxyCallback) (const char *webTag, const ArkWeb_JavaScriptBridgeData *dataArray, size_t arraySize, void *userData)
334```
335**Description**
336
337Defines a callback used when the proxy method is executed.
338
339**Since**: 12
340
341
342### ArkWeb_OnMessageEventHandler
343
344```
345typedef void(* ArkWeb_OnMessageEventHandler) (const char *webTag, const ArkWeb_WebMessagePortPtr port, const ArkWeb_WebMessagePtr message, void *userData)
346```
347**Description**
348
349Defines a callback used to process the post message data sent by the HTML page.
350
351**Since**: 12
352
353**Parameters**
354
355| Name| Description|
356| -------- | -------- |
357| webTag | Name of a **Web** component. |
358| port | Post message port. |
359| message | Post message data. |
360| userData | User-defined data.|
361
362
363### ArkWeb_OnRequestStart
364
365```
366typedef void(* ArkWeb_OnRequestStart) (const ArkWeb_SchemeHandler *schemeHandler, ArkWeb_ResourceRequest *resourceRequest, const ArkWeb_ResourceHandler *resourceHandler, bool *intercept)
367```
368**Description**
369
370Defines a callback used to start the request on the I/O thread.
371
372**System capability**: SystemCapability.Web.Webview.Core
373
374**Since**: 12
375
376**Parameters**
377
378| Name| Description|
379| -------- | -------- |
380| schemeHandler | ArkWeb_SchemeHandler. |
381| resourceRequest | The object used to obtain the request information. |
382| resourceHandler | **ArkWeb_ResourceHandler** of the request. If **intercept** is set to **false**, this parameter should not be used. |
383| intercept | If the value is **true**, the request will be intercepted. If the value is **false**, the request will not be intercepted.|
384
385
386### ArkWeb_OnRequestStop
387
388```
389typedef void(* ArkWeb_OnRequestStop) (const ArkWeb_SchemeHandler *schemeHandler, const ArkWeb_ResourceRequest *resourceRequest)
390```
391**Description**
392
393Defines a callback used when the request is stopped.
394
395This callback is used on the IO thread.
396
397The **resourceRequest** can be destroyed using **ArkWeb_ResourceRequest_Destroy**,
398
399and **ArkWeb_ResourceHandler_Destroy** can be used to destroy the **ArkWeb_ResourceHandler** received in **ArkWeb_OnRequestStart**.
400
401**System capability**: SystemCapability.Web.Webview.Core
402
403**Since**: 12
404
405**Parameters**
406
407| Name| Description|
408| -------- | -------- |
409| schemeHandler | ArkWeb_SchemeHandler. |
410| resourceRequest | ArkWeb_ResourceRequest.|
411
412
413### ArkWeb_RequestHeaderList
414
415```
416typedef struct ArkWeb_RequestHeaderList_ ArkWeb_RequestHeaderList
417```
418**Description**
419
420Defines a struct for the request header list.
421
422**System capability**: SystemCapability.Web.Webview.Core
423
424**Since**: 12
425
426
427### ArkWeb_ResourceHandler
428
429```
430typedef struct ArkWeb_ResourceHandler_ ArkWeb_ResourceHandler
431```
432**Description**
433
434Defines a struct for the intercepted URL requests.
435
436You can use **ArkWeb_ResourceHandler** to send defined request headers and bodies.
437
438**System capability**: SystemCapability.Web.Webview.Core
439
440**Since**: 12
441
442
443### ArkWeb_ResourceRequest
444
445```
446typedef struct ArkWeb_ResourceRequest_ ArkWeb_ResourceRequest
447```
448**Description**
449
450Defines a struct for resource request. Through **OH_ArkWeb_ResourceRequest**, you can obtain the URL, method, post data, and other information of the request.
451
452**System capability**: SystemCapability.Web.Webview.Core
453
454**Since**: 12
455
456
457### ArkWeb_ResourceType
458
459```
460typedef enum ArkWeb_ResourceType ArkWeb_ResourceType
461```
462**Description**
463
464Defines an enum for the resource types.
465
466The resource types match the corresponding items of ResourceType in Chromium and should not be renumbered.
467
468**System capability**: SystemCapability.Web.Webview.Core
469
470**Since**: 12
471
472
473### ArkWeb_Response
474
475```
476typedef struct ArkWeb_Response_ ArkWeb_Response
477```
478**Description**
479
480Defines a struct for **ArkWeb_Response** for the intercepted request.
481
482**System capability**: SystemCapability.Web.Webview.Core
483
484**Since**: 12
485
486
487### ArkWeb_SchemeHandler
488
489```
490typedef struct ArkWeb_SchemeHandler_ ArkWeb_SchemeHandler
491```
492**Description**
493
494Defines a struct for the **SchemeHandler** of a specified scheme.
495
496**System capability**: SystemCapability.Web.Webview.Core
497
498**Since**: 12
499
500
501### ArkWeb_WebMessagePortPtr
502
503```
504typedef struct ArkWeb_WebMessagePort* ArkWeb_WebMessagePortPtr
505```
506**Description**
507
508Defines a struct for the pointer to the message port struct.
509
510**Since**: 12
511
512
513### ArkWeb_WebMessagePtr
514
515```
516typedef struct ArkWeb_WebMessage* ArkWeb_WebMessagePtr
517```
518**Description**
519
520Defines a struct for the pointer to the data struct of post message.
521
522**Since**: 12
523
524
525### ArkWeb_WebMessageType
526
527```
528typedef enum ArkWeb_WebMessageType ArkWeb_WebMessageType
529```
530**Description**
531
532Defines an enum for the data types of post message.
533
534**Since**: 12
535
536
537### NativeArkWeb_OnDestroyCallback
538
539```
540typedef void(* NativeArkWeb_OnDestroyCallback) (const char *)
541```
542**Description**
543
544Defines a callback used when the **Web** component is destroyed.
545
546**Since**: 11
547
548
549### NativeArkWeb_OnJavaScriptCallback
550
551```
552typedef void(* NativeArkWeb_OnJavaScriptCallback) (const char *)
553```
554**Description**
555
556Defines a callback used to return the result after the JavaScript code is executed.
557
558**Since**: 11
559
560
561### NativeArkWeb_OnJavaScriptProxyCallback
562
563```
564typedef char*(* NativeArkWeb_OnJavaScriptProxyCallback) (const char **argv, int32_t argc)
565```
566**Description**
567
568Defines a callback of the injected object.
569
570**Since**: 11
571
572
573### NativeArkWeb_OnValidCallback
574
575```
576typedef void(* NativeArkWeb_OnValidCallback) (const char *)
577```
578**Description**
579
580Defines a callback used when the **Web** component is valid.
581
582**Since**: 11
583
584
585## Enum Description
586
587
588### ArkWeb_CustomSchemeOption
589
590```
591enum ArkWeb_CustomSchemeOption
592```
593**Description**
594
595Enumerates the custom scheme options.
596
597**System capability**: SystemCapability.Web.Webview.Core
598
599**Since**: 12
600
601| Value| Description|
602| -------- | -------- |
603| ARKWEB_SCHEME_OPTION_STANDARD  | If **ARKWEB_SCHEME_OPTION_STANDARD** is set, the scheme is processed as a standard scheme. The standard scheme must comply with the URL normalization and parsing rules defined in section 3.1 of [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt).  |
604| ARKWEB_SCHEME_OPTION_LOCAL  | If **ARKWEB_SCHEME_OPTION_LOCAL** is set, the scheme is processed using the same security rule as the file URL.  |
605| ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED  | If **ARKWEB_SCHEME_OPTION_DISPLAY_ISOLATED** is set, the request of the scheme can be initiated only by the page loaded using the same scheme.  |
606| ARKWEB_SCHEME_OPTION_SECURE  | If **ARKWEB_SCHEME_OPTION_SECURE** is set, the scheme is processed using the same security rule as the HTTPS URL.  |
607| ARKWEB_SCHEME_OPTION_CORS_ENABLED  | If **ARKWEB_SCHEME_OPTION_CORS_ENABLED** is set, the scheme can send CORS requests. In most cases, this value should be set when **ARKWEB_SCHEME_OPTION_STANDARD** is set.  |
608| ARKWEB_SCHEME_OPTION_CSP_BYPASSING  | If **ARKWEB_SCHEME_OPTION_CSP_BYPASSING** is set, the scheme can bypass the Content Security Policy (CSP) check. In most cases, this value should not be set when **ARKWEB_SCHEME_OPTION_STANDARD** is set.  |
609| ARKWEB_SCHEME_OPTION_FETCH_ENABLED  | If **ARKWEB_SCHEME_OPTION_FETCH_ENABLED** is set, the FETCH API request of the scheme can be initiated.  |
610| ARKWEB_SCHEME_OPTION_CODE_CACHE_ENABLED  | If **ARKWEB_SCHEME_OPTION_CODE_CACHE_ENABLED** is set, the JS resources of the scheme support code cache.  |
611
612
613### ArkWeb_ErrorCode
614
615```
616enum ArkWeb_ErrorCode
617```
618**Description**
619
620Enumerates the error codes of ArkWeb NDK APIs.
621
622**System capability**: SystemCapability.Web.Webview.Core
623
624**Since**: 12
625
626| Value| Description|
627| -------- | -------- |
628| ARKWEB_SUCCESS  | Successful execution.  |
629| ARKWEB_INIT_ERROR  | Failed initialization.  |
630| ARKWEB_ERROR_UNKNOWN  | Unknown error.  |
631| ARKWEB_INVALID_PARAM  | Invalid parameter.  |
632| ARKWEB_SCHEME_REGISTER_FAILED  | The scheme configuration failed to be registered. You need to register the scheme before creating the ArkWeb.  |
633| ARKWEB_INVALID_URL  | Invalid URL.  |
634| ARKWEB_INVALID_COOKIE_VALUE  | Invalid cookie value.  |
635
636
637### ArkWeb_NativeAPIVariantKind
638
639```
640enum ArkWeb_NativeAPIVariantKind
641```
642**Description**
643
644Enumerates the native API types.
645
646**Since**: 12
647
648| Value| Description|
649| -------- | -------- |
650| ARKWEB_NATIVE_COMPONENT  | APIs related to the **Web** component.  |
651| ARKWEB_NATIVE_CONTROLLER  | APIs related to controller.  |
652| ARKWEB_NATIVE_WEB_MESSAGE_PORT  | APIs related to **webMessagePort**.  |
653| ARKWEB_NATIVE_WEB_MESSAGE  | APIs related to **webMessage**.  |
654| ARKWEB_NATIVE_COOKIE_MANAGER  | APIs related to **cookieManager**.  |
655
656
657### ArkWeb_NetError
658
659```
660enum ArkWeb_NetError
661```
662**Description**
663
664Enumerates the error codes of the ArkWeb network protocol stack.
665
666**System capability**: SystemCapability.Web.Webview.Core
667
668**Since**: 12
669
670| Value| Description|
671| -------- | -------- |
672| ARKWEB_NET_OK  | The operation is normal.  |
673| ARKWEB_ERR_IO_PENDING  | The asynchronous I/O operation is pending. This usually does not mean a fatal error. Typically, this error is generated as a notification to wait for an external notification indicating that the I/O operation is finally completed.  |
674| ARKWEB_ERR_FAILED  | The operation fails.  |
675| ARKWEB_ERR_ABORTED  | The operation is aborted (due to user operation).  |
676| ARKWEB_ERR_INVALID_ARGUMENT  | The parameter is invalid.  |
677| ARKWEB_ERR_INVALID_HANDLE  | The handle or file descriptor is invalid.  |
678| ARKWEB_ERR_FILE_NOT_FOUND  | The file or directory cannot be found.  |
679| ARKWEB_ERR_TIMED_OUT  | The operation timed out.  |
680| ARKWEB_ERR_FILE_TOO_LARGE  | The file is too large.  |
681| ARKWEB_ERR_UNEXPECTED  | An unexpected error occurs. This may be caused by programming errors or invalid assumptions.  |
682| ARKWEB_ERR_ACCESS_DENIED  | The access to resources other than the network is denied.  |
683| ARKWEB_ERR_NOT_IMPLEMENTED  | The operation fails because the function is not implemented.  |
684| ARKWEB_ERR_INSUFFICIENT_RESOURCES  | The resources are insufficient to complete the operation.  |
685| ARKWEB_ERR_OUT_OF_MEMORY  | A memory overflow occurs.  |
686| ARKWEB_ERR_UPLOAD_FILE_CHANGED  | The file fails to be loaded because the modification time of the file is not as expected.  |
687| ARKWEB_ERR_SOCKET_NOT_CONNECTED  | The socket is not connected.  |
688| ARKWEB_ERR_FILE_EXISTS  | The file already exists.  |
689| ARKWEB_ERR_FILE_PATH_TOO_LONG  | The file path or file name is too long.  |
690| ARKWEB_ERR_FILE_NO_SPACE  | The disk space is insufficient.  |
691| ARKWEB_ERR_FILE_VIRUS_INFECTED  | The file is infected.  |
692| ARKWEB_ERR_BLOCKED_BY_CLIENT  | The request is blocked by the client.  |
693| ARKWEB_ERR_NETWORK_CHANGED  | The network is changed.  |
694| ARKWEB_ERR_BLOCKED_BY_ADMINISTRATOR  | The request is blocked by the URL blocking list configured by the domain administrator.  |
695| ARKWEB_ERR_SOCKET_CONNECTED  | The socket is connected.  |
696| ARKWEB_ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED  | The upload stream needs to be rewind due to retry or redirection. However, the uploading fails because the rewinding is not supported.  |
697| ARKWEB_ERR_CONTEXT_SHUT_DOWN  | The request failed because **URLRequestContext** is shut down or being shut down.  |
698| ARKWEB_ERR_BLOCKED_BY_RESPONSE  | The request is blocked by response from headers such as X-Frame-Options, Content Security Policy, and Cross Origin Resource Policy.  |
699| ARKWEB_ERR_CLEARTEXT_NOT_PERMITTED  | The request is blocked because some or all cleartext requests are not permitted by the system policy.  |
700| ARKWEB_ERR_BLOCKED_BY_CSP  | The request is blocked by the Content Security Policy.  |
701| ARKWEB_ERR_H2_OR_QUIC_REQUIRED  | The request is blocked because there is no H/2 or QUIC session.  |
702| ARKWEB_ERR_BLOCKED_BY_ORB  | The request is blocked by Cross-Origin Read Blocking (CORB) or ORB.  |
703| ARKWEB_ERR_CONNECTION_CLOSED  | The connection is closed, which is displayed as **TCP FIN**.  |
704| ARKWEB_ERR_CONNECTION_RESET  | The connection is reset, which is displayed as **TCP RST**.  |
705| ARKWEB_ERR_CONNECTION_REFUSED  | The connection is denied.  |
706| ARKWEB_ERR_CONNECTION_ABORTED  | The connection is aborted because the ACK for sending data is not received. This may include FIN packets.  |
707| ARKWEB_ERR_CONNECTION_FAILED  | The connection failed.  |
708| ARKWEB_ERR_NAME_NOT_RESOLVED  | The domain name cannot be resolved.  |
709| ARKWEB_ERR_INTERNET_DISCONNECTED  | The Internet is disconnected.  |
710| ARKWEB_ERR_SSL_PROTOCOL_ERROR  | An SSL protocol error occurs.  |
711| ARKWEB_ERR_ADDRESS_INVALID  | The IP address or port number is invalid (for example, IP address 0 or port 0 cannot be connected).  |
712| ARKWEB_ERR_ADDRESS_UNREACHABLE  | The IP address is unreachable. This means that there is no route to the specified host or network.  |
713| ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NEEDED  | The server needs SSL client authentication certificate.  |
714| ARKWEB_ERR_TUNNEL_CONNECTION_FAILED  | The tunnel connection failed to be established through the proxy.  |
715| ARKWEB_ERR_NO_SSL_VERSIONS_ENABLED  | No SSL protocol version is enabled.  |
716| ARKWEB_ERR_SSL_VERSION_OR_CIPHER_MISMATCH  | The client and server do not support the common SSL protocol version or cipher suite.  |
717| ARKWEB_ERR_SSL_RENEGOTIATION_REQUESTED  | The server requests re-negotiation (re-handshake).  |
718| ARKWEB_ERR_PROXY_AUTH_UNSUPPORTED  | The proxy requests authentication used to establish a tunnel, but the method used is not supported.  |
719| ARKWEB_ERR_BAD_SSL_CLIENT_AUTH_CERT  | The SSL handshake fails because the client certificate is incorrect or missing.  |
720| ARKWEB_ERR_CONNECTION_TIMED_OUT  | The connection timed out.  |
721| ARKWEB_ERR_HOST_RESOLVER_QUEUE_TOO_LARGE  | The number of DNS resolutions is too large, so a request in the queue is aborted.  |
722| ARKWEB_ERR_SOCKS_CONNECTION_FAILED  | The connection between the target host and the SOCKS proxy server failed.  |
723| ARKWEB_ERR_SOCKS_CONNECTION_HOST_UNREACHABLE  | The SOCKS proxy server cannot be connected to the target host because the host is unreachable.  |
724| ARKWEB_ERR_ALPN_NEGOTIATION_FAILED  | The request of ALPN failed.  |
725| ARKWEB_ERR_SSL_NO_RENEGOTIATION  | The peer sent an **SSL_NO_RENEGOTIATION** alert message.  |
726| ARKWEB_ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES  | Winsock sometimes reports unexpected written bytes. This may be caused by LSP damage.  |
727| ARKWEB_ERR_SSL_DECOMPRESSION_FAILURE_ALERT  | The SSL peer sent us a fatal **DECOMPRESSION_FAILURE** alert. This usually occurs when the peer falsely considers that it supports **DEFLATE** and selects it.  |
728| ARKWEB_ERR_SSL_BAD_RECORD_MAC_ALERT  | The SSL peer sent us a fatal **BAD_RECORD_MAC** alert. This usually occurs on the server cannot support **DEFLATE** normally.  |
729| ARKWEB_ERR_PROXY_AUTH_REQUESTED  | The proxy requests authentication (used to establish a tunnel).  |
730| ARKWEB_ERR_PROXY_CONNECTION_FAILED  | The connection to the proxy server cannot be established. This is because an error occurs when the host resolves the name or connects its socket to the proxy server. Note that this does not include errors during the **HTTP CONNECT**.  |
731| ARKWEB_ERR_MANDATORY_PROXY_CONFIGURATION_FAILED  | The mandatory proxy configuration failed. Currently, this means that a mandatory PAC script cannot be obtained, parsed, or executed.  |
732| ARKWEB_ERR_PRECONNECT_MAX_SOCKET_LIMIT  | The maximum socket limit in the socket pool is reached when pre-connect. No more sockets need to be pre-connected.  |
733| ARKWEB_ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED  | The access to the private key of the SSL client certificate is denied.  |
734| ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY  | The SSL client certificate does not have a private key.  |
735| ARKWEB_ERR_PROXY_CERTIFICATE_INVALID  | The certificate provided by the HTTPS proxy is invalid.  |
736| ARKWEB_ERR_NAME_RESOLUTION_FAILED  | The name resolution (DNS) failed.  |
737| ARKWEB_ERR_NETWORK_ACCESS_DENIED  | The access to the network is denied. This error is distinguished from errors that are likely to be caused by firewalls and other errors whose access is denied. See **ERR_ACCESS_DENIED**.  |
738| ARKWEB_ERR_TEMPORARILY_THROTTLED  | The request is temporarily throttled to avoid DDoS attacks.  |
739| ARKWEB_ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT  | The request for creating an SSL tunnel connection through the HTTPS proxy receives a 302 (temporary redirection) response. The response body may contain the description of the failure cause.  |
740| ARKWEB_ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED  | The CertificateVerify data of the SSL client authentication handshake cannot be signed using the private key of the client certificate. Possible reasons for this include that the user implicitly or explicitly denies access to the private key, the private key may not be available for signature, the key may rely on an invalid cache handle, or the CSP may not allow arbitrary data to be signed.  |
741| ARKWEB_ERR_MSG_TOO_BIG  | The message is too big to transfer. (for example, the UDP message exceeds the size limit).  |
742| ARKWEB_ERR_WS_PROTOCOL_ERROR  | The WebSocket protocol is incorrect. This indicates that the connection is terminating due to a frame format error or other protocol violation.  |
743| ARKWEB_ERR_ADDRESS_IN_USE  | The address is in use.  |
744| ARKWEB_ERR_SSL_HANDSHAKE_NOT_COMPLETED  | The operation failed because the SSL handshake is not completed.  |
745| ARKWEB_ERR_SSL_BAD_PEER_PUBLIC_KEY  | The public key of the SSL peer is invalid.  |
746| ARKWEB_ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN  | The certificate does not match the built-in public key Pins of the host name. Pin is set in **net/http/transport_security_state.cc**, and it is required that one of a set of public keys exist on the path from the leaf node to the root node.  |
747| ARKWEB_ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED  | The server requests the client certificate, but the request does not contain any of the certificates we support.  |
748| ARKWEB_ERR_SSL_DECRYPT_ERROR_ALERT  | The SSL peer sent us a fatal **DECRYPT_ERROR** alert. This usually occurs when the peer cannot verify the signature (in CertificateVerify or ServerKeyExchange) or verify the **Finished** message.  |
749| ARKWEB_ERR_WS_THROTTLE_QUEUE_TOO_LARGE  | There are too many WebSocketJob instances to be processed. Therefore, new tasks are not pushed to the queue.  |
750| ARKWEB_ERR_SSL_SERVER_CERT_CHANGED  | During the renegotiation, the SSL server certificate is changed.  |
751| ARKWEB_ERR_SSL_UNRECOGNIZED_NAME_ALERT  | The SSL server sends us a fatal UNRECOGNIZED_NAME alert.  |
752| ARKWEB_ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR  | The receive buffer size of the socket cannot be set as requested.  |
753| ARKWEB_ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR  | The send buffer size of the socket cannot be set as requested.  |
754| ARKWEB_ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE  | The setsockopt returns a success code, but the socket's receive buffer size cannot be set to the requested value.  |
755| ARKWEB_ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE  | The setsockopt returns a success code, but the socket's send buffer size cannot be set to the requested value.  |
756| ARKWEB_ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT  | The client certificate cannot be imported into the SSL library from the platform store.  |
757| ARKWEB_ERR_ICANN_NAME_COLLISION  | When a host name is resolved to an IP address list, the IPv4 address 127.0.53.53 is included. This is a special IP address recommended by ICANN. It is used to indicate that there is a name conflict and remind administrators of potential problems.  |
758| ARKWEB_ERR_SSL_SERVER_CERT_BAD_FORMAT  | The SSL server provides a certificate that cannot be decoded. This is not a certificate error code because no X509Certificate object is available. This error is fatal.  |
759| ARKWEB_ERR_CT_STH_PARSING_FAILED  | Certificate Transparency: The received **Signed Tree Head** cannot be parsed.  |
760| ARKWEB_ERR_CT_STH_INCOMPLETE  | Certificate transparency: The received **Signed Tree Head** can be successfully parsed into JSON, but some fields are missing.  |
761| ARKWEB_ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH  | The connection to send proxy authentication credentials cannot be reused before AuthController is start. The caller should reconnect the AuthController. This error is only used internally in the network stack.  |
762| ARKWEB_ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED  | Certificate transparency: The received proof of consistency cannot be parsed.  |
763| ARKWEB_ERR_SSL_OBSOLETE_CIPHER  | The SSL server requires an obsolete cipher suite. In one or two version updates after this cipher suite is removed, as a rollback policy, this error is temporarily signaled and then the rollback policy is removed.  |
764| ARKWEB_ERR_WS_UPGRADE  | This error code is used to cancel the URLRequest when the WebSocket handshake is successful and the connection has been upgraded.  |
765| ARKWEB_ERR_READ_IF_READY_NOT_IMPLEMENTED  | The **READ_IF_READY** of the socket is not implemented. This error should not be seen by the user because the normal **Read** method will be used as an alternative.  |
766| ARKWEB_ERR_NO_BUFFER_SPACE  | No socket buffer space is available.  |
767| ARKWEB_ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS  | There is no common signing algorithm between the private key of the local end certificate and the preferences of the server.  |
768| ARKWEB_ERR_EARLY_DATA_REJECTED  | The server rejected **TLS 1.3 Early Data**. This error will be received before any data is returned from the socket. **Early Data** should be disabled and the request should be retried.  |
769| ARKWEB_ERR_WRONG_VERSION_ON_EARLY_DATA  | The server responds with TLS 1.2 or earlier when TLS 1.3 Early Data is provided. This is an internal error code to solve the backward compatibility problem between Early Data and TLS 1.2. This error code will be received before the socket returns any data. Early Data should be disabled and the request should be retried. For details, see https://tools.ietf.org/html/rfc8446\#appendix-D.3.  |
770| ARKWEB_ERR_TLS13_DOWNGRADE_DETECTED  | The server negotiated an earlier version when TLS 1.3 is supported. This is part of the TLS 1.3 security check, but it may also indicate that the TLS termination proxy incorrectly implements TLS 1.2. (See https://crbug.com/boringssl/226.)  |
771| ARKWEB_ERR_SSL_KEY_USAGE_INCOMPATIBLE  | The server's certificate has a keyUsage extension that is incompatible with the negotiated TLS key exchange method.  |
772| ARKWEB_ERR_INVALID_ECH_CONFIG_LIST  | The **ECHConfigList** obtained through the DNS cannot be resolved.  |
773| ARKWEB_ERR_ECH_NOT_NEGOTIATED  | **Encrypted Client Hello (ECH)** is enabled, but the server cannot decrypt the encrypted **ClientHello**.  |
774| ARKWEB_ERR_ECH_FALLBACK_CERTIFICATE_INVALID  | **Encrypted Client Hello (ECH)** is enabled, but the server cannot decrypt the encrypted **ClientHello** and does not provide a certificate valid for the public name.  |
775| ARKWEB_ERR_CERT_COMMON_NAME_INVALID  | The server responds with a certificate whose common name does not match the host name. The possible causes are: 1. The attacker redirects the traffic to its server and presents a certificate that they know the private key.<br>1. The server is incorrectly configured and responds with an incorrect certificate.3. The user is on the wireless network and is redirected to the login page of the network.4. The operating system uses the **DNS** search suffix, but the server does not provide a certificate for the abbreviated name in the address bar. |
776| ARKWEB_ERR_CERT_DATE_INVALID  | The server responds with a certificate, but according to the host clock, the certificate does not take effect or is expired. This may be one of the following: 1. The attacker provides an old certificate and obtains the private key.2. 2. The server is incorrectly configured and no valid certificate is provided.3. The host clock is wrong.  |
777| ARKWEB_ERR_CERT_AUTHORITY_INVALID  | The server responds with a certificate signed by an authority that we do not trust. The possible causes are: 1. The attacker replaces the real certificate with a certificate that contains its public key and is signed by its associates.<br>1. The server has a valid certificate from a CA that we do not know but should trust.3. The server presents a self-signed certificate, which cannot defend against active attackers but passive attackers. |
778| ARKWEB_ERR_CERT_CONTAINS_ERRORS  | The certificate returned by the server contains an error. This error cannot be rectified. MSDN describes this error as "The SSL certificate contains an error". Note: It is not clear how this error differs from **ERR_CERT_INVALID**. To maintain consistency, replace this error with the **ERR_CERT_INVALID** code.  |
779| ARKWEB_ERR_CERT_NO_REVOCATION_MECHANISM  | The certificate does not have a revocation mechanism. In other words, this certificate cannot be revoked.  |
780| ARKWEB_ERR_CERT_UNABLE_TO_CHECK_REVOCATION  | Revocation information for this website's security certificate is not available. The possible causes are: 1. The attacker has cracked the private key in the certificate and prevented the host from finding out that the certificate is revoked.2. 2. The certificate is not revoked, but the revocation server is busy or unavailable.  |
781| ARKWEB_ERR_CERT_REVOKED  | The certificate responded by the server is revoked. This error could but not should be ignored.  |
782| ARKWEB_ERR_CERT_INVALID  | The server responds with an invalid certificate. This error cannot be rectified. MSDN describes this error as follows: "The SSL certificate is invalid."   |
783| ARKWEB_ERR_CERT_WEAK_SIGNATURE_ALGORITHM  | The server responds with a certificate signed using a weak signing algorithm.  |
784| ARKWEB_ERR_CERT_NON_UNIQUE_NAME  | The host name specified in the certificate is not unique.  |
785| ARKWEB_ERR_CERT_WEAK_KEY  | The server responds with a certificate containing a weak key (for example, a too small RSA key).  |
786| ARKWEB_ERR_CERT_NAME_CONSTRAINT_VIOLATION  | The **DNS** suffix declared in the certificate violates the name constraint.  |
787| ARKWEB_ERR_CERT_VALIDITY_TOO_LONG  | The validity period of the certificate is too long.  |
788| ARKWEB_ERR_CERTIFICATE_TRANSPARENCY_REQUIRED  | The **Certificate Transparency** is required, but the server does not provide CT information that complies with the policy.  |
789| ARKWEB_ERR_CERT_SYMANTEC_LEGACY  | The certificate is linked to an old Symantec certificate or its subsidiaries that are no longer trusted.  |
790| ARKWEB_ERR_CERT_KNOWN_INTERCEPTION_BLOCKED  | It is known that the certificate is intercepted by an entity other than the device owner.  |
791| ARKWEB_ERR_SSL_OBSOLETE_VERSION_OR_CIPHER  | The connection uses an obsolete version of SSL/TLS or an encryption algorithm.  |
792| ARKWEB_ERR_CERT_END  | The error immediately follows the last certificate error code.  |
793| ARKWEB_ERR_INVALID_URL  | The URL is invalid.  |
794| ARKWEB_ERR_DISALLOWED_URL_SCHEME  | The scheme of the URL is not allowed.  |
795| ARKWEB_ERR_UNKNOWN_URL_SCHEME  | The scheme of the URL is unknown.  |
796| ARKWEB_ERR_INVALID_REDIRECT  | An invalid URL is redirected when loads a URL.  |
797| ARKWEB_ERR_TOO_MANY_REDIRECTS  | Too many URLs are redirected when loads a URL.  |
798| ARKWEB_ERR_UNSAFE_REDIRECT  | An insecure URL is redirected when loads a URL (for example, redirection to **file://** is insecure).  |
799| ARKWEB_ERR_UNSAFE_PORT  | The port number of the URL to be loaded is unsafe.  |
800| ARKWEB_ERR_INVALID_RESPONSE  | The response from the server is invalid.  |
801| ARKWEB_ERR_INVALID_CHUNKED_ENCODING  | The chunked encoding is invalid.  |
802| ARKWEB_ERR_METHOD_UNSUPPORTED  | The server does not support the request method.  |
803| ARKWEB_ERR_UNEXPECTED_PROXY_AUTH  | The response value is **407**, indicating proxy authentication is required, but the host does not send the request to the proxy.  |
804| ARKWEB_ERR_EMPTY_RESPONSE  | The server closes the connection and does not response.  |
805| ARKWEB_ERR_RESPONSE_HEADERS_TOO_BIG  | The response headers are too big.  |
806| ARKWEB_ERR_PAC_SCRIPT_FAILED  | The PAC script failed.  |
807| ARKWEB_ERR_REQUEST_RANGE_NOT_SATISFIABLE  | The response code is 416, indicating the server cannot meet the request range.  |
808| ARKWEB_ERR_MALFORMED_IDENTITY  | The identity is malformed.  |
809| ARKWEB_ERR_CONTENT_DECODING_FAILED  | The content decoding of the response body failed.  |
810| ARKWEB_ERR_NETWORK_IO_SUSPENDED  | The operation failed because all network I/Os are suspended.  |
811| ARKWEB_ERR_SYN_REPLY_NOT_RECEIVED  | FLIP data is received before **SYN_REPLY** is received on the flow.  |
812| ARKWEB_ERR_ENCODING_CONVERSION_FAILED  | The response failed to be converted to the target encoding.  |
813| ARKWEB_ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT  | The server sent an unrecognized FTP directory listing format.  |
814| ARKWEB_ERR_NO_SUPPORTED_PROXIES  | There are no supported proxies in the list provided.  |
815| ARKWEB_ERR_HTTP2_PROTOCOL_ERROR  | An HTTP/2 protocol error occurs.  |
816| ARKWEB_ERR_INVALID_AUTH_CREDENTIALS  | The HTTP authentication credentials are invalid.  |
817| ARKWEB_ERR_UNSUPPORTED_AUTH_SCHEME  | The HTTP authentication scheme is not supported.  |
818| ARKWEB_ERR_ENCODING_DETECTION_FAILED  | The encoding detection failed.  |
819| ARKWEB_ERR_MISSING_AUTH_CREDENTIALS  |  (GSSAPI) There Kerberos credentials of HTTP authentication are missing.  |
820| ARKWEB_ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS  | The SSPI or GSSAPI status code is unexpected.  |
821| ARKWEB_ERR_MISCONFIGURED_AUTH_ENVIRONMENT  | The authentication environment is misconfigured. (For example, the KDC cannot be found or the principal is unknown).  |
822| ARKWEB_ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS  | The SSPI or GSSAPI status code is undocumented.  |
823| ARKWEB_ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN  | The HTTP response body is too big to drain.  |
824| ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH  | Multiple Content-Length response headers are included in an HTTP response.  |
825| ARKWEB_ERR_INCOMPLETE_HTTP2_HEADERS  | The HTTP/2 response headers are incomplete. Therefore, more frames are needed to complete them.  |
826| ARKWEB_ERR_PAC_NOT_IN_DHCP  | The PAC URL configuration cannot be retrieved from DHCP. This may indicate that the retrieving failed, or that the PAC URL is not configured in DHCP.  |
827| ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION  | Multiple **Content-Disposition** headers are included in an HTTP response.  |
828| ARKWEB_ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION  | Multiple **Location** headers are included in an HTTP response.  |
829| ARKWEB_ERR_HTTP2_SERVER_REFUSED_STREAM  | The HTTP/2 server rejects the request without processing it and sends a **GOAWAY** frame with an error code **NO_ERROR** and a **Last-Stream-ID** lower than the **Stream ID** of the request, or the **RST_STREAM** frame with the error code **REFUSED_STREAM** indicating that the request is not processed. The client can retry the request (on a different connection). For details, see "section 8.1.4 in RFC7540".  |
830| ARKWEB_ERR_HTTP2_PING_FAILED  | The HTTP/2 server does not respond to the **PING**.  |
831| ARKWEB_ERR_CONTENT_LENGTH_MISMATCH  | When the connection is closed, the number of bytes transmitted in the HTTP response body is less than the number of bytes advertised in the **Content-Length** header.  |
832| ARKWEB_ERR_INCOMPLETE_CHUNKED_ENCODING  | The HTTP response body is transmitted using chunked encoding, and the terminated zero-length block is not sent when the connection is closed.  |
833| ARKWEB_ERR_QUIC_PROTOCOL_ERROR  | A QUIC protocol error occurs.  |
834| ARKWEB_ERR_RESPONSE_HEADERS_TRUNCATED  | The HTTP response headers are truncated by the end of file (EOF).  |
835| ARKWEB_ERR_QUIC_HANDSHAKE_FAILED  | The QUIC encryption handshake failed. This means that the server cannot read any requests, so they may be resent.  |
836| ARKWEB_ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY  | The transport security is inadequate to HTTP/2.  |
837| ARKWEB_ERR_HTTP2_FLOW_CONTROL_ERROR  | The peer violates HTTP/2 flow control.  |
838| ARKWEB_ERR_HTTP2_FRAME_SIZE_ERROR  | The peer sends an HTTP/2 frame of an incorrect size.  |
839| ARKWEB_ERR_HTTP2_COMPRESSION_ERROR  | The decoding or encoding of the compressed HTTP/2 response headers failed.  |
840| ARKWEB_ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION  | The proxy authentication of a request does not have a valid client socket handle.  |
841| ARKWEB_ERR_HTTP_1_1_REQUIRED  | The HTTP/2 session receives an **HTTP_1_1_REQUIRED** error code.  |
842| ARKWEB_ERR_PROXY_HTTP_1_1_REQUIRED  | The **HTTP_1_1_REQUIRED** error code is received when the HTTP/2 session proxy is used.  |
843| ARKWEB_ERR_PAC_SCRIPT_TERMINATED  | The PAC script has been terminated and must be reloaded.  |
844| ARKWEB_ERR_INVALID_HTTP_RESPONSE  | The server should return an **HTTP/1.x** response. But it returns an **HTTP/0.9** response.  |
845| ARKWEB_ERR_CONTENT_DECODING_INIT_FAILED  | The content decoding fails to be initialized.  |
846| ARKWEB_ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED  | An **HTTP/2 RST_STREAM** frame with **NO_ERROR** is received. This error should be handled internally by HTTP/2 and should not exceed the SpdyStream layer.  |
847| ARKWEB_ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE  | The pushed stream claimed by the request is not available.  |
848| ARKWEB_ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER  | The claimed pushed stream is reset by the server. In this case, the request should be retried.  |
849| ARKWEB_ERR_TOO_MANY_RETRIES  | There are too many retries due to invalid authentication or certificate.  |
850| ARKWEB_ERR_HTTP2_STREAM_CLOSED  | An HTTP/2 frame is received on the closed stream.  |
851| ARKWEB_ERR_HTTP2_CLIENT_REFUSED_STREAM  | The client refuses an HTTP/2 stream.  |
852| ARKWEB_ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH  | Based on the matched URL and request header, an HTTP/2 push stream is received by the request, but the pushed response header does not match the request.  |
853| ARKWEB_ERR_HTTP_RESPONSE_CODE_FAILURE  | The server returns a **non-2xx** HTTP response code.  |
854| ARKWEB_ERR_QUIC_UNKNOWN_CERT_ROOT  | The certificate displayed on the QUIC connection is not linked to a known root certificate, and the connected original server is not in the list of domain names that allow unknown root certificates.  |
855| ARKWEB_ERR_QUIC_GOAWAY_REQUEST_CAN_BE_RETRIED  | A **GOAWAY** frame has been received, indicating that the request has not been processed and therefore can be safely retried on a different connection.  |
856| ARKWEB_ERR_TOO_MANY_ACCEPT_CH_RESTARTS  | The **ACCEPT_CH_RESTARTS** has been triggered too many times.  |
857| ARKWEB_ERR_INCONSISTENT_IP_ADDRESS_SPACE  | In the same request, the IP address space of the remote endpoint is different from the previous one. Cache entries for any affected requests should be marked as invalid.  |
858| ARKWEB_ERR_CACHED_IP_ADDRESS_SPACE_BLOCKED_BY_LOCAL_NETWORK_ACCESS_POLICY  | The cached IP address space of the remote endpoint is blocked by a local network access policy.  |
859| ARKWEB_ERR_CACHE_MISS  | There is no entry of the request in the cache.  |
860| ARKWEB_ERR_CACHE_READ_FAILURE  | The entry cannot be read from the cache.  |
861| ARKWEB_ERR_CACHE_WRITE_FAILURE  | The entry cannot be written to the cache.  |
862| ARKWEB_ERR_CACHE_OPERATION_UNSUPPORTED  | The entry of the request is not supported by the cache.  |
863| ARKWEB_ERR_CACHE_OPEN_FAILURE  | The cache could not open this entry.  |
864| ARKWEB_ERR_CACHE_CREATE_FAILURE  | The cache could not create this entry.  |
865| ARKWEB_ERR_CACHE_RACE  | Multiple transactions are competing to create disk cache entries.  |
866| ARKWEB_ERR_CACHE_CHECKSUM_READ_FAILURE  | The cache could not read the checksum on the entry.  |
867| ARKWEB_ERR_CACHE_CHECKSUM_MISMATCH  | An entry with an invalid checksum is found in the cache.  |
868| ARKWEB_ERR_CACHE_LOCK_TIMEOUT  | The HTTP cache contains error code.  |
869| ARKWEB_ERR_CACHE_AUTH_FAILURE_AFTER_READ  | A challenge is received after the transaction reads some data, but the credentials are unavailable.  |
870| ARKWEB_ERR_CACHE_ENTRY_NOT_SUITABLE  | This error code is for internal, non-standard HTTP caching.  |
871| ARKWEB_ERR_CACHE_DOOM_FAILURE  | The cache cannot delete this entry.  |
872| ARKWEB_ERR_CACHE_OPEN_OR_CREATE_FAILURE  | The cache could not open or create this entry.  |
873| ARKWEB_ERR_INSECURE_RESPONSE  | The server response is insecure (for example, there is a certificate error).  |
874| ARKWEB_ERR_NO_PRIVATE_KEY_FOR_CERT  | The client certificate failed to be imported because the user's key database does not have a private key.  |
875| ARKWEB_ERR_ADD_USER_CERT_FAILED  | The certificate failed to be added to the operating system database.  |
876| ARKWEB_ERR_INVALID_SIGNED_EXCHANGE  | The signed exchange is invalid.  |
877| ARKWEB_ERR_INVALID_WEB_BUNDLE  | The Web Bundle resources are invalid.  |
878| ARKWEB_ERR_TRUST_TOKEN_OPERATION_FAILED  | The request for performing the Trust Tokens protocol operation failed. The possible causes include prerequisite failure, internal error, and bad response.  |
879| ARKWEB_ERR_TRUST_TOKEN_OPERATION_SUCCESS_WITHOUT_SENDING_REQUEST  | When processing an operation execution request related to the Trust Tokens protocol, the system performs the Trust Tokens operation in the request, but does not send the request to the specified destination.  |
880| ARKWEB_ERR_FTP_FAILED  | The FTP control connection command failed. If possible, replace this error code with a more specific one.  |
881| ARKWEB_ERR_FTP_SERVICE_UNAVAILABLE  | The server cannot support the request. This is a temporary error. The FTP response code is 421.  |
882| ARKWEB_ERR_FTP_TRANSFER_ABORTED  | The server aborts the transfer. The FTP response code is 426.  |
883| ARKWEB_ERR_FTP_FILE_BUSY  | The file is in use, or some other temporary error occurs when the file is opened. The FTP response code is 450.  |
884| ARKWEB_ERR_FTP_SYNTAX_ERROR  | The server rejects the command from the host due to a syntax error. The FTP response code is 500 or 501.  |
885| ARKWEB_ERR_FTP_COMMAND_UNSUPPORTED  | The server does not support the command. The FTP response code is 502 or 504.  |
886| ARKWEB_ERR_FTP_BAD_COMMAND_SEQUENCE  | The server rejects the commands from the host because the host does not send the commands in the correct sequence. The FTP response code is 503.  |
887| ARKWEB_ERR_PKCS12_IMPORT_BAD_PASSWORD  | The **PKCS \#12** file cannot be imported because the password is incorrect.  |
888| ARKWEB_ERR_PKCS12_IMPORT_FAILED  | The **PKCS \#12** file cannot be imported due to other errors.  |
889| ARKWEB_ERR_IMPORT_CA_CERT_NOT_CA  | The CA certificate cannot be imported because it is not a real CA certificate.  |
890| ARKWEB_ERR_IMPORT_CERT_ALREADY_EXISTS  | The certificate cannot be imported because it already exists in the database.  |
891| ARKWEB_ERR_IMPORT_CA_CERT_FAILED  | The CA failed to be imported due to other errors.  |
892| ARKWEB_ERR_IMPORT_SERVER_CERT_FAILED  | The server certificate failed to be imported due to some internal errors.  |
893| ARKWEB_ERR_PKCS12_IMPORT_INVALID_MAC  | The **PKCS \#12** file failed to be imported because the message authentication code (MAC) is invalid.  |
894| ARKWEB_ERR_PKCS12_IMPORT_INVALID_FILE  | The **PKCS \#12** file failed to be imported because the file is invalid or corrupted.  |
895| ARKWEB_ERR_PKCS12_IMPORT_UNSUPPORTED  | The **PKCS \#12** file failed to be imported due to its unsupported features.  |
896| ARKWEB_ERR_KEY_GENERATION_FAILED  | The key generation failed.  |
897| ARKWEB_ERR_PRIVATE_KEY_EXPORT_FAILED  | The private key failed to be exported.  |
898| ARKWEB_ERR_SELF_SIGNED_CERT_GENERATION_FAILED  | The self-signed certificate failed to be generated.  |
899| ARKWEB_ERR_CERT_DATABASE_CHANGED  | The certificate database is changed.  |
900| ARKWEB_ERR_CERT_VERIFIER_CHANGED  | The certificate verifier configuration is changed.  |
901| ARKWEB_ERR_DNS_MALFORMED_RESPONSE  | The DNS resolver receives a response that the format is incorrect.  |
902| ARKWEB_ERR_DNS_SERVER_REQUIRES_TCP  | The DNS server requires TCP.  |
903| ARKWEB_ERR_DNS_SERVER_FAILED  | The DNS server failed. This error is returned for all of the following cases: 1 - Format error - The name server cannot interpret the query. 2-Server failure: The name server cannot process the query due to its own problems. 3-Not Implemented: The name server does not support the query type of the request. 4-Rejection: The name server refuses to perform the specified operation for policy reasons.  |
904| ARKWEB_ERR_DNS_TIMED_OUT  | The DNS transaction timed out.  |
905| ARKWEB_ERR_DNS_CACHE_MISS  | The entry is not found in the cache or other local sources.  |
906| ARKWEB_ERR_DNS_SEARCH_EMPTY  | The suffix search list rule prevents the resolution of a given host name.  |
907| ARKWEB_ERR_DNS_SORT_ERROR  | Addresses are not sorted according to RFC 3484.  |
908| ARKWEB_ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED  | The host name of the DNS-over-HTTPS server cannot be resolved.  |
909| ARKWEB_ERR_DNS_NAME_HTTPS_ONLY  | DNS has identified that the request is prohibited due to insecure connections (HTTP/WS). The application should handle this error like HTTP redirection, redirecting the connection to secure HTTPS or WSS.  |
910| ARKWEB_ERR_DNS_REQUEST_CANCELED  | All DNS requests related to this task are canceled.  |
911| ARKWEB_ERR_DNS_NO_MATCHING_SUPPORTED_ALPN  | The host name resolution of the HTTPS record is not resolved using the ALPN value of the supported protocol.  |
912
913### ArkWeb_ResourceType
914
915```
916enum ArkWeb_ResourceType
917```
918**Description**
919
920Enumerates the resource types.
921
922The resource types match the corresponding items of ResourceType in Chromium and should not be renumbered.
923
924**System capability**: SystemCapability.Web.Webview.Core
925
926**Since**: 12
927
928| Value| Description|
929| -------- | -------- |
930| MAIN_FRAME  | Top-level page.  |
931| SUB_FRAME  | Frame or Iframe.  |
932| STYLE_SHEET  | CSS style sheet.  |
933| SCRIPT  | External script.  |
934| IMAGE  | images (jpg/gif/png/ and others).  |
935| FONT_RESOURCE  | Fount resource.  |
936| SUB_RESOURCE  | Other sub-resources. If the type is unknown, the default type is used.  |
937| OBJECT  | The Object (or embedded) tag of the plug-in, or the resource requested by the plug-in.  |
938| MEDIA  | Media resource  |
939| WORKER  | Main resource of the dedicated worker thread.  |
940| SHARED_WORKER  | Main resource of the share worker thread.  |
941| PREFETCH  | Explicit prefetch request.  |
942| FAVICON  | Website icon.  |
943| XHR  | XMLHttpRequest.  |
944| PING  | Ping request of **/sendBeacon**.  |
945| SERVICE_WORKER  | Main resource of the service worker.  |
946| CSP_REPORT  | Report of Content Security Policy violation.  |
947| PLUGIN_RESOURCE  | Resource requested by the plug-in.  |
948| NAVIGATION_PRELOAD_MAIN_FRAME  | Main frame redirection request that triggers service worker warm-up.  |
949| NAVIGATION_PRELOAD_SUB_FRAME  | Subframe redirection request that triggers service worker warm-up.  |
950
951
952### ArkWeb_WebMessageType
953
954```
955enum ArkWeb_WebMessageType
956```
957**Description**
958
959Enumerates the data types of post message.
960
961**Since**: 12
962
963| Value| Description|
964| -------- | -------- |
965| ARKWEB_NONE  | Incorrect data.  |
966| ARKWEB_STRING  | String data.  |
967| ARKWEB_BUFFER  | Byte stream data.  |
968
969
970## Function Description
971
972
973### OH_ArkWeb_ClearSchemeHandlers()
974
975```
976int32_t OH_ArkWeb_ClearSchemeHandlers (const char * webTag)
977```
978**Description**
979
980Clears the **SchemeHandler** registered for the specified web.
981
982**System capability**: SystemCapability.Web.Webview.Core
983
984**Since**: 12
985
986**Parameters**
987
988| Name| Description|
989| -------- | -------- |
990| webTag | Tag that uniquely identifies a **Web** component. Ensure that it is unique. |
991
992**Returns**
993
994If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
995
996
997### OH_ArkWeb_CreateResponse()
998
999```
1000void OH_ArkWeb_CreateResponse (ArkWeb_Response ** response)
1001```
1002**Description**
1003
1004Creates an **ArkWeb_Response** object for the intercepted request.
1005
1006**System capability**: SystemCapability.Web.Webview.Core
1007
1008**Since**: 12
1009
1010**Parameters**
1011
1012| Name| Description|
1013| -------- | -------- |
1014| response | Returns the created **ArkWeb_Response**. Use **OH_ArkWeb_DestoryResponse** to destroy it when it is not required.|
1015
1016
1017### OH_ArkWeb_CreateSchemeHandler()
1018
1019```
1020void OH_ArkWeb_CreateSchemeHandler (ArkWeb_SchemeHandler ** schemeHandler)
1021```
1022**Description**
1023
1024Creates an **ArkWeb_SchemeHandler** object.
1025
1026**System capability**: SystemCapability.Web.Webview.Core
1027
1028**Since**: 12
1029
1030**Parameters**
1031
1032| Name| Description|
1033| -------- | -------- |
1034| schemeHandler | Returns the created **ArkWeb_SchemeHandler**. You can use **OH_ArkWeb_DestoryschemeHandler** to destroy it when it is not needed.|
1035
1036
1037### OH_ArkWeb_DestroyResponse()
1038
1039```
1040void OH_ArkWeb_DestroyResponse (ArkWeb_Response * response)
1041```
1042**Description**
1043
1044Destroys an **ArkWeb_Response** object.
1045
1046**System capability**: SystemCapability.Web.Webview.Core
1047
1048**Since**: 12
1049
1050**Parameters**
1051
1052| Name| Description|
1053| -------- | -------- |
1054| response | The **ArkWeb_Response** to be destroyed.|
1055
1056
1057### OH_ArkWeb_DestroySchemeHandler()
1058
1059```
1060void OH_ArkWeb_DestroySchemeHandler (ArkWeb_SchemeHandler * schemeHandler)
1061```
1062**Description**
1063
1064Destroys an **ArkWeb_SchemeHandler** object.
1065
1066**System capability**: SystemCapability.Web.Webview.Core
1067
1068**Since**: 12
1069
1070**Parameters**
1071
1072| Name| Description|
1073| -------- | -------- |
1074| schemeHandler | The **ArkWeb_SchemeHandler** to be destroyed.|
1075
1076
1077### OH_ArkWeb_GetNativeAPI()
1078
1079```
1080ArkWeb_AnyNativeAPI* OH_ArkWeb_GetNativeAPI (ArkWeb_NativeAPIVariantKind type)
1081```
1082**Description**
1083
1084Obtains the native API struct based on the transferred API type.
1085
1086**System capability**: SystemCapability.Web.Webview.Core
1087
1088**Since**: 12
1089
1090**Parameters**
1091
1092| Name| Description|
1093| -------- | -------- |
1094| type | The native API types supported by ArkWeb. |
1095
1096**Returns**
1097
1098The corresponding native API structure pointer is returned based on the input API type. The first member of the structure is the size of the current structure.
1099
1100
1101### OH_ArkWeb_RegisterCustomSchemes()
1102
1103```
1104int32_t OH_ArkWeb_RegisterCustomSchemes (const char * scheme, int32_t option )
1105```
1106**Description**
1107
1108Registers a custom scheme with the **ArkWeb**.
1109
1110This function should not be called for built-in HTTP, HTTPS, FILE, FTP, ABOUT, and DATA protocols.
1111
1112This function should be called on the main thread and before kernel initialization.
1113
1114**System capability**: SystemCapability.Web.Webview.Core
1115
1116**Since**: 12
1117
1118**Parameters**
1119
1120| Name| Description|
1121| -------- | -------- |
1122| scheme | Scheme to be registered. |
1123| option | Scheme options. |
1124
1125**Returns**
1126
1127If **0** is returned, the operation is successful. If **17100100** is returned, an unknown error occurs. If **17100101** is returned, the parameter is invalid. If **17100102** is returned, the configuration of the scheme fails to be registered. The scheme should be registered before the ArkWeb is created.
1128
1129
1130### OH_ArkWeb_ReleaseByteArray()
1131
1132```
1133void OH_ArkWeb_ReleaseByteArray (uint8_t * byteArray)
1134```
1135**Description**
1136
1137Releases the byte array created by NDK APIs.
1138
1139**System capability**: SystemCapability.Web.Webview.Core
1140
1141**Since**: 12
1142
1143**Parameters**
1144
1145| Name| Description|
1146| -------- | -------- |
1147| byteArray | Byte array to be released.|
1148
1149
1150### OH_ArkWeb_ReleaseString()
1151
1152```
1153void OH_ArkWeb_ReleaseString (char * string)
1154```
1155**Description**
1156
1157Releases the string created by NDK APIs.
1158
1159**System capability**: SystemCapability.Web.Webview.Core
1160
1161**Since**: 12
1162
1163**Parameters**
1164
1165| Name| Description|
1166| -------- | -------- |
1167| string | Character string to be released.|
1168
1169
1170### OH_ArkWeb_SetSchemeHandler()
1171
1172```
1173bool OH_ArkWeb_SetSchemeHandler (const char * scheme, const char * webTag, ArkWeb_SchemeHandler * schemeHandler )
1174```
1175**Description**
1176
1177Sets an **ArkWeb_SchemeHandler** for a specified scheme to intercept requests of this scheme.
1178
1179The **SchemeHandler** should be set after **BrowserContext** is created.
1180
1181You can use **WebviewController.initializeWebEngine** to initialize **BrowserContext** without creating the ArkWeb component.
1182
1183**System capability**: SystemCapability.Web.Webview.Core
1184
1185**Since**: 12
1186
1187**Parameters**
1188
1189| Name| Description|
1190| -------- | -------- |
1191| scheme | The scheme to be intercepted. |
1192| webTag | Tag that uniquely identifies a **Web** component. Ensure that it is unique. |
1193| schemeHandler | The **ArkWeb_SchemeHandler** for this scheme. Only requests triggered from the specified web are notified through this **SchemeHandler**. |
1194
1195**Returns**
1196
1197If the **SchemeHandler** is successfully set for the specified scheme, **true** is returned. Otherwise, **false** is returned.
1198
1199
1200### OH_ArkWebHttpBodyStream_GetPosition()
1201
1202```
1203uint64_t OH_ArkWebHttpBodyStream_GetPosition (const ArkWeb_HttpBodyStream * httpBodyStream)
1204```
1205**Description**
1206
1207Obtains the position of **httpBodyStream**.
1208
1209**System capability**: SystemCapability.Web.Webview.Core
1210
1211**Since**: 12
1212
1213**Parameters**
1214
1215| Name| Description|
1216| -------- | -------- |
1217| httpBodyStream | ArkWeb_HttpBodyStream. |
1218
1219**Returns**
1220
1221The position of **httpBodyStream**. If **httpBodyStream** is invalid, the position value is **0**.
1222
1223
1224### OH_ArkWebHttpBodyStream_GetSize()
1225
1226```
1227uint64_t OH_ArkWebHttpBodyStream_GetSize (const ArkWeb_HttpBodyStream * httpBodyStream)
1228```
1229**Description**
1230
1231Obtains the size of **httpBodyStream**.
1232
1233When data is transmitted in blocks or **httpBodyStream** is invalid, **0** is always returned.
1234
1235**System capability**: SystemCapability.Web.Webview.Core
1236
1237**Since**: 12
1238
1239**Parameters**
1240
1241| Name| Description|
1242| -------- | -------- |
1243| httpBodyStream | ArkWeb_HttpBodyStream. |
1244
1245**Returns**
1246
1247The size of **httpBodyStream**.
1248
1249
1250### OH_ArkWebHttpBodyStream_GetUserData()
1251
1252```
1253void* OH_ArkWebHttpBodyStream_GetUserData (const ArkWeb_HttpBodyStream * httpBodyStream)
1254```
1255**Description**
1256
1257Obtains user data from **ArkWeb_HttpBodyStream**.
1258
1259**System capability**: SystemCapability.Web.Webview.Core
1260
1261**Since**: 12
1262
1263**Parameters**
1264
1265| Name| Description|
1266| -------- | -------- |
1267| httpBodyStream | ArkWeb_HttpBodyStream. |
1268
1269**Returns**
1270
1271Returns the user data.
1272
1273
1274### OH_ArkWebHttpBodyStream_Init()
1275
1276```
1277int32_t OH_ArkWebHttpBodyStream_Init (ArkWeb_HttpBodyStream * httpBodyStream, ArkWeb_HttpBodyStreamInitCallback initCallback )
1278```
1279**Description**
1280
1281Initializes **ArkWeb_HttpBodyStream**.
1282
1283This function must be called before any other function is called. This API needs to be called in the I/O thread.
1284
1285**System capability**: SystemCapability.Web.Webview.Core
1286
1287**Since**: 12
1288
1289**Parameters**
1290
1291| Name| Description|
1292| -------- | -------- |
1293| httpBodyStream | ArkWeb_HttpBodyStream. |
1294| initCallback | Callback used to initialize. |
1295
1296**Returns**
1297
1298If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1299
1300
1301### OH_ArkWebHttpBodyStream_IsChunked()
1302
1303```
1304bool OH_ArkWebHttpBodyStream_IsChunked (const ArkWeb_HttpBodyStream * httpBodyStream)
1305```
1306**Description**
1307
1308Determines whether **httpBodyStream** is chunked to transfer.
1309
1310**System capability**: SystemCapability.Web.Webview.Core
1311
1312**Since**: 12
1313
1314**Parameters**
1315
1316| Name| Description|
1317| -------- | -------- |
1318| httpBodyStream | ArkWeb_HttpBodyStream. |
1319
1320**Returns**
1321
1322If **httpBodyStream** is chunked to transfer, **true** is returned. Otherwise, **false** is returned.
1323
1324
1325### OH_ArkWebHttpBodyStream_IsEof()
1326
1327```
1328bool OH_ArkWebHttpBodyStream_IsEof (const ArkWeb_HttpBodyStream * httpBodyStream)
1329```
1330**Description**
1331
1332Returns **true** if all data in **httpBodyStream** is read.
1333
1334Returns **false** before reading the chunked **httpBodyStream** the first time.
1335
1336**System capability**: SystemCapability.Web.Webview.Core
1337
1338**Since**: 12
1339
1340**Parameters**
1341
1342| Name| Description|
1343| -------- | -------- |
1344| httpBodyStream | ArkWeb_HttpBodyStream. |
1345
1346**Returns**
1347
1348If all data has been read, **true** is returned. Otherwise, **false** is returned.
1349
1350
1351### OH_ArkWebHttpBodyStream_IsInMemory()
1352
1353```
1354bool OH_ArkWebHttpBodyStream_IsInMemory (const ArkWeb_HttpBodyStream * httpBodyStream)
1355```
1356**Description**
1357
1358Returns **true** if all the upload data in **httpBodyStream** is in memory and all read requests will be synchronized successfully.
1359
1360Returns **false** if the data is chunked to transfer.
1361
1362**System capability**: SystemCapability.Web.Webview.Core
1363
1364**Since**: 12
1365
1366**Parameters**
1367
1368| Name| Description|
1369| -------- | -------- |
1370| httpBodyStream | ArkWeb_HttpBodyStream. |
1371
1372**Returns**
1373
1374If all the uploaded data is stored in the memory, **true** is returned. Otherwise, **false** is returned.
1375
1376
1377### OH_ArkWebHttpBodyStream_Read()
1378
1379```
1380void OH_ArkWebHttpBodyStream_Read (const ArkWeb_HttpBodyStream * httpBodyStream, uint8_t * buffer, int bufLen )
1381```
1382**Description**
1383
1384Exports upload data of the request to the buffer.
1385
1386The buffer size must be greater than the value of **bufLen**. The data from the worker thread is exported to the buffer. Therefore, before the callback returns, the buffer should not be used in other threads to avoid concurrency problems.
1387
1388**System capability**: SystemCapability.Web.Webview.Core
1389
1390**Since**: 12
1391
1392**Parameters**
1393
1394| Name| Description|
1395| -------- | -------- |
1396| httpBodyStream | ArkWeb_HttpBodyStream. |
1397| buffer | Buffer for receiving data. |
1398| bufLen | Size of the byte to be read.|
1399
1400
1401### OH_ArkWebHttpBodyStream_SetReadCallback()
1402
1403```
1404int32_t OH_ArkWebHttpBodyStream_SetReadCallback (ArkWeb_HttpBodyStream * httpBodyStream, ArkWeb_HttpBodyStreamReadCallback readCallback )
1405```
1406**Description**
1407
1408Sets a callback for **OH_ArkWebHttpBodyStream_Read**.
1409
1410The result of **OH_ArkWebHttpBodyStream_Read** is notified to the caller through **readCallback**.
1411
1412This callback will run in the same thread as **OH_ArkWebHttpBodyStream_Read**.
1413
1414**System capability**: SystemCapability.Web.Webview.Core
1415
1416**Since**: 12
1417
1418**Parameters**
1419
1420| Name| Description|
1421| -------- | -------- |
1422| httpBodyStream | ArkWeb_HttpBodyStream. |
1423| readCallback | Callback of **OH_ArkWebHttpBodyStream_Read**. |
1424
1425**Returns**
1426
1427If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1428
1429
1430### OH_ArkWebHttpBodyStream_SetUserData()
1431
1432```
1433int32_t OH_ArkWebHttpBodyStream_SetUserData (ArkWeb_HttpBodyStream * httpBodyStream, void * userData )
1434```
1435**Description**
1436
1437Sets user data to the **ArkWeb_HttpBodyStream** object.
1438
1439**System capability**: SystemCapability.Web.Webview.Core
1440
1441**Since**: 12
1442
1443**Parameters**
1444
1445| Name| Description|
1446| -------- | -------- |
1447| httpBodyStream | ArkWeb_HttpBodyStream. |
1448| userData | The user data to be set. |
1449
1450**Returns**
1451
1452If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1453
1454
1455### OH_ArkWebRequestHeaderList_Destroy()
1456
1457```
1458void OH_ArkWebRequestHeaderList_Destroy (ArkWeb_RequestHeaderList * requestHeaderList)
1459```
1460**Description**
1461
1462Destroys an **ArkWeb_RequestHeaderList** object.
1463
1464**System capability**: SystemCapability.Web.Webview.Core
1465
1466**Since**: 12
1467
1468**Parameters**
1469
1470| Name| Description|
1471| -------- | -------- |
1472| requestHeaderList | The **ArkWeb_RequestHeaderList** to be destroyed.|
1473
1474
1475### OH_ArkWebRequestHeaderList_GetHeader()
1476
1477```
1478void OH_ArkWebRequestHeaderList_GetHeader (const ArkWeb_RequestHeaderList * requestHeaderList, int32_t index, char ** key, char ** value )
1479```
1480**Description**
1481
1482Obtains a specified request header.
1483
1484**System capability**: SystemCapability.Web.Webview.Core
1485
1486**Since**: 12
1487
1488**Parameters**
1489
1490| Name| Description|
1491| -------- | -------- |
1492| requestHeaderList | The request header list. |
1493| index | The index of the request headers. |
1494| key | The key of a request header. You should use the **OH_ArkWeb_ReleaseString** function to release the string. |
1495| value | The value of a request header. You should use the **OH_ArkWeb_ReleaseString** function to release the string.|
1496
1497
1498### OH_ArkWebRequestHeaderList_GetSize()
1499
1500```
1501int32_t OH_ArkWebRequestHeaderList_GetSize (const ArkWeb_RequestHeaderList * requestHeaderList)
1502```
1503**Description**
1504
1505Obtains the size of a request header list.
1506
1507**System capability**: SystemCapability.Web.Webview.Core
1508
1509**Since**: 12
1510
1511**Parameters**
1512
1513| Name| Description|
1514| -------- | -------- |
1515| requestHeaderList | The request header list. |
1516
1517**Returns**
1518
1519The size of the request header. If **requestHeaderList** is invalid, the value is -1.
1520
1521
1522### OH_ArkWebResourceHandler_Destroy()
1523
1524```
1525int32_t OH_ArkWebResourceHandler_Destroy (const ArkWeb_ResourceHandler * resourceHandler)
1526```
1527**Description**
1528
1529Destroys an **ArkWeb_ResourceHandler** object.
1530
1531**System capability**: SystemCapability.Web.Webview.Core
1532
1533**Since**: 12
1534
1535**Parameters**
1536
1537| Name| Description|
1538| -------- | -------- |
1539| resourceHandler | ArkWeb_ResourceHandler. |
1540
1541**Returns**
1542
1543If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1544
1545
1546### OH_ArkWebResourceHandler_DidFailWithError()
1547
1548```
1549int32_t OH_ArkWebResourceHandler_DidFailWithError (const ArkWeb_ResourceHandler * resourceHandler, ArkWeb_NetError errorCode )
1550```
1551**Description**
1552
1553Notifies the ArkWeb kernel that the intercepted request fails.
1554
1555**System capability**: SystemCapability.Web.Webview.Core
1556
1557**Since**: 12
1558
1559**Parameters**
1560
1561| Name| Description|
1562| -------- | -------- |
1563| resourceHandler | **ArkWeb_ResourceHandler** of the request. |
1564| errorCode | The error code for a request. For details, see [arkweb_net_error_list.h](arkweb__net__error__list_8h.md). |
1565
1566**Returns**
1567
1568If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1569
1570
1571### OH_ArkWebResourceHandler_DidFinish()
1572
1573```
1574int32_t OH_ArkWebResourceHandler_DidFinish (const ArkWeb_ResourceHandler * resourceHandler)
1575```
1576**Description**
1577
1578Notifies the ArkWeb kernel that the request is intercepted and that no more data is available.
1579
1580**System capability**: SystemCapability.Web.Webview.Core
1581
1582**Since**: 12
1583
1584**Parameters**
1585
1586| Name| Description|
1587| -------- | -------- |
1588| resourceHandler | **ArkWeb_ResourceHandler** of the request. |
1589
1590**Returns**
1591
1592If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1593
1594
1595### OH_ArkWebResourceHandler_DidReceiveData()
1596
1597```
1598int32_t OH_ArkWebResourceHandler_DidReceiveData (const ArkWeb_ResourceHandler * resourceHandler, const uint8_t * buffer, int64_t bufLen )
1599```
1600**Description**
1601
1602Sends a response body to the intercepted request.
1603
1604**System capability**: SystemCapability.Web.Webview.Core
1605
1606**Since**: 12
1607
1608**Parameters**
1609
1610| Name| Description|
1611| -------- | -------- |
1612| resourceHandler | **ArkWeb_ResourceHandler** of the request. |
1613| buffer | The buffer data to be sent. |
1614| bufLen | The buffer size. |
1615
1616**Returns**
1617
1618If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1619
1620
1621### OH_ArkWebResourceHandler_DidReceiveResponse()
1622
1623```
1624int32_t OH_ArkWebResourceHandler_DidReceiveResponse (const ArkWeb_ResourceHandler * resourceHandler, const ArkWeb_Response * response )
1625```
1626**Description**
1627
1628Sends a response header to the intercepted request.
1629
1630**System capability**: SystemCapability.Web.Webview.Core
1631
1632**Since**: 12
1633
1634**Parameters**
1635
1636| Name| Description|
1637| -------- | -------- |
1638| resourceHandler | **ArkWeb_ResourceHandler** of the request. |
1639| response | The **ArkWeb_Response** of the intercepted request. |
1640
1641**Returns**
1642
1643If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1644
1645
1646### OH_ArkWebResourceRequest_Destroy()
1647
1648```
1649int32_t OH_ArkWebResourceRequest_Destroy (const ArkWeb_ResourceRequest * resourceRequest)
1650```
1651**Description**
1652
1653Destroys an **ArkWeb_ResourceRequest** object.
1654
1655**System capability**: SystemCapability.Web.Webview.Core
1656
1657**Since**: 12
1658
1659**Parameters**
1660
1661| Name| Description|
1662| -------- | -------- |
1663| resourceRequest | ArkWeb_ResourceRequest. |
1664
1665**Returns**
1666
1667If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1668
1669
1670### OH_ArkWebResourceRequest_DestroyHttpBodyStream()
1671
1672```
1673void OH_ArkWebResourceRequest_DestroyHttpBodyStream (ArkWeb_HttpBodyStream * httpBodyStream)
1674```
1675**Description**
1676
1677Destroys an **ArkWeb_HttpBodyStream** object.
1678
1679**System capability**: SystemCapability.Web.Webview.Core
1680
1681**Since**: 12
1682
1683**Parameters**
1684
1685| Name| Description|
1686| -------- | -------- |
1687| httpBodyStream | The **httpBodyStream** to be destroyed.|
1688
1689
1690### OH_ArkWebResourceRequest_GetFrameUrl()
1691
1692```
1693void OH_ArkWebResourceRequest_GetFrameUrl (const ArkWeb_ResourceRequest * resourceRequest, char ** frameUrl )
1694```
1695**Description**
1696
1697Obtains the URL of the frame that triggers the request.
1698
1699**System capability**: SystemCapability.Web.Webview.Core
1700
1701**Since**: 12
1702
1703**Parameters**
1704
1705| Name| Description|
1706| -------- | -------- |
1707| resourceRequest | ArkWeb_ResourceRequest. |
1708| frameUrl | The URL of the frame that triggers the request. This function allocates memory for the URL string. You should release the string using **OH_ArkWeb_ReleaseString**.|
1709
1710
1711### OH_ArkWebResourceRequest_GetHttpBodyStream()
1712
1713```
1714void OH_ArkWebResourceRequest_GetHttpBodyStream (const ArkWeb_ResourceRequest * resourceRequest, ArkWeb_HttpBodyStream ** httpBodyStream )
1715```
1716**Description**
1717
1718Creates an **ArkWeb_HttpBodyStream** to read the uploaded data of the request.
1719
1720**System capability**: SystemCapability.Web.Webview.Core
1721
1722**Since**: 12
1723
1724**Parameters**
1725
1726| Name| Description|
1727| -------- | -------- |
1728| resourceRequest | ArkWeb_ResourceRequest. |
1729| httpBodyStream | The uploaded data of the request. This function allocates memory for **httpBodyStream**. You should use **OH_ArkWebResourceRequest_DestroyHttpBodyStream** to release **httpBodyStream**.|
1730
1731
1732### OH_ArkWebResourceRequest_GetMethod()
1733
1734```
1735void OH_ArkWebResourceRequest_GetMethod (const ArkWeb_ResourceRequest * resourceRequest, char ** method )
1736```
1737**Description**
1738
1739Obtains the method of a request.
1740
1741**System capability**: SystemCapability.Web.Webview.Core
1742
1743**Since**: 12
1744
1745**Parameters**
1746
1747| Name| Description|
1748| -------- | -------- |
1749| resourceRequest | ArkWeb_ResourceRequest. |
1750| method | The method of an HTTP request. This function allocates memory for the **method** string. You should use **OH_ArkWeb_ReleaseString** to release the string.|
1751
1752
1753### OH_ArkWebResourceRequest_GetReferrer()
1754
1755```
1756void OH_ArkWebResourceRequest_GetReferrer (const ArkWeb_ResourceRequest * resourceRequest, char ** referrer )
1757```
1758**Description**
1759
1760Obtains the **Referrer** of a request.
1761
1762**System capability**: SystemCapability.Web.Webview.Core
1763
1764**Since**: 12
1765
1766**Parameters**
1767
1768| Name| Description|
1769| -------- | -------- |
1770| resourceRequest | ArkWeb_ResourceRequest. |
1771| referrer | The **Referrer** of a request. This function allocates memory for the **Referrer** string. You should use **OH_ArkWeb_ReleaseString** to release the string.|
1772
1773
1774### OH_ArkWebResourceRequest_GetRequestHeaders()
1775
1776```
1777void OH_ArkWebResourceRequest_GetRequestHeaders (const ArkWeb_ResourceRequest * resourceRequest, ArkWeb_RequestHeaderList ** requestHeaderList )
1778```
1779**Description**
1780
1781Obtains the **OH_ArkWeb_RequestHeaderList** of a request.
1782
1783**System capability**: SystemCapability.Web.Webview.Core
1784
1785**Since**: 12
1786
1787**Parameters**
1788
1789| Name| Description|
1790| -------- | -------- |
1791| resourceRequest | ArkWeb_ResourceRequest. |
1792| requestHeaderList | The list of request headers.|
1793
1794
1795### OH_ArkWebResourceRequest_GetResourceType()
1796
1797```
1798int32_t OH_ArkWebResourceRequest_GetResourceType (const ArkWeb_ResourceRequest * resourceRequest)
1799```
1800**Description**
1801
1802Obtains the resource type of a request.
1803
1804**System capability**: SystemCapability.Web.Webview.Core
1805
1806**Since**: 12
1807
1808**Parameters**
1809
1810| Name| Description|
1811| -------- | -------- |
1812| resourceRequest | ArkWeb_ResourceRequest. |
1813
1814**Returns**
1815
1816Returns the resource type of the request. If **resourceRequest** is invalid, the value is -1.
1817
1818
1819### OH_ArkWebResourceRequest_GetUrl()
1820
1821```
1822void OH_ArkWebResourceRequest_GetUrl (const ArkWeb_ResourceRequest * resourceRequest, char ** url )
1823```
1824**Description**
1825
1826Obtains the URL of a request.
1827
1828**System capability**: SystemCapability.Web.Webview.Core
1829
1830**Since**: 12
1831
1832**Parameters**
1833
1834| Name| Description|
1835| -------- | -------- |
1836| resourceRequest | ArkWeb_ResourceRequest. |
1837| url | The URL of a request. This function allocates memory for the URL string. You should release the string using **OH_ArkWeb_ReleaseString**.|
1838
1839
1840### OH_ArkWebResourceRequest_GetUserData()
1841
1842```
1843void* OH_ArkWebResourceRequest_GetUserData (const ArkWeb_ResourceRequest * resourceRequest)
1844```
1845**Description**
1846
1847Obtains user data from **ArkWeb_ResourceRequest**.
1848
1849**System capability**: SystemCapability.Web.Webview.Core
1850
1851**Since**: 12
1852
1853**Parameters**
1854
1855| Name| Description|
1856| -------- | -------- |
1857| resourceRequest | ArkWeb_ResourceRequest. |
1858
1859**Returns**
1860
1861Returns the user data.
1862
1863
1864### OH_ArkWebResourceRequest_HasGesture()
1865
1866```
1867bool OH_ArkWebResourceRequest_HasGesture (const ArkWeb_ResourceRequest * resourceRequest)
1868```
1869**Description**
1870
1871Determines whether a request is triggered by the user gesture.
1872
1873**System capability**: SystemCapability.Web.Webview.Core
1874
1875**Since**: 12
1876
1877**Parameters**
1878
1879| Name| Description|
1880| -------- | -------- |
1881| resourceRequest | ArkWeb_ResourceRequest. |
1882
1883**Returns**
1884
1885Returns **true** if this is triggered by a user gesture; otherwise returns false.
1886
1887
1888### OH_ArkWebResourceRequest_IsMainFrame()
1889
1890```
1891bool OH_ArkWebResourceRequest_IsMainFrame (const ArkWeb_ResourceRequest * resourceRequest)
1892```
1893**Description**
1894
1895Determines whether a request is from the main frame.
1896
1897**System capability**: SystemCapability.Web.Webview.Core
1898
1899**Since**: 12
1900
1901**Parameters**
1902
1903| Name| Description|
1904| -------- | -------- |
1905| resourceRequest | ArkWeb_ResourceRequest. |
1906
1907**Returns**
1908
1909Returns **true** if this is from the main framework; otherwise returns **false**.
1910
1911
1912### OH_ArkWebResourceRequest_IsRedirect()
1913
1914```
1915bool OH_ArkWebResourceRequest_IsRedirect (const ArkWeb_ResourceRequest * resourceRequest)
1916```
1917**Description**
1918
1919Determines whether a request is redirect.
1920
1921**System capability**: SystemCapability.Web.Webview.Core
1922
1923**Since**: 12
1924
1925**Parameters**
1926
1927| Name| Description|
1928| -------- | -------- |
1929| resourceRequest | ArkWeb_ResourceRequest. |
1930
1931**Returns**
1932
1933If this is a redirection, **true** is returned. Otherwise, **false** is returned.
1934
1935
1936### OH_ArkWebResourceRequest_SetUserData()
1937
1938```
1939int32_t OH_ArkWebResourceRequest_SetUserData (ArkWeb_ResourceRequest * resourceRequest, void * userData )
1940```
1941**Description**
1942
1943Sets user data to the **ArkWeb_ResourceRequest** object.
1944
1945**System capability**: SystemCapability.Web.Webview.Core
1946
1947**Since**: 12
1948
1949**Parameters**
1950
1951| Name| Description|
1952| -------- | -------- |
1953| resourceRequest | ArkWeb_ResourceRequest. |
1954| userData | The user data to be set. |
1955
1956**Returns**
1957
1958If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
1959
1960
1961### OH_ArkWebResponse_GetCharset()
1962
1963```
1964void OH_ArkWebResponse_GetCharset (const ArkWeb_Response * response, char ** charset )
1965```
1966**Description**
1967
1968Obtains the character set of **ArkWeb_Response**.
1969
1970**System capability**: SystemCapability.Web.Webview.Core
1971
1972**Since**: 12
1973
1974**Parameters**
1975
1976| Name| Description|
1977| -------- | -------- |
1978| response | ArkWeb_Response. |
1979| charset | The character set of **ArkWeb_Response**. This function allocates memory for the **charset** string. You need to release the string using **OH_ArkWeb_ReleaseString**.|
1980
1981
1982### OH_ArkWebResponse_GetError()
1983
1984```
1985ArkWeb_NetError OH_ArkWebResponse_GetError (const ArkWeb_Response * response)
1986```
1987**Description**
1988
1989Obtains the error code of **ArkWeb_Response**.
1990
1991**System capability**: SystemCapability.Web.Webview.Core
1992
1993**Since**: 12
1994
1995**Parameters**
1996
1997| Name| Description|
1998| -------- | -------- |
1999| response | ArkWeb_Response. |
2000
2001**Returns**
2002
2003The error code of **ArkWeb_Response**.
2004
2005
2006### OH_ArkWebResponse_GetHeaderByName()
2007
2008```
2009void OH_ArkWebResponse_GetHeaderByName (const ArkWeb_Response * response, const char * name, char ** value )
2010```
2011**Description**
2012
2013Obtains the header from **ArkWeb_Response**.
2014
2015**System capability**: SystemCapability.Web.Webview.Core
2016
2017**Since**: 12
2018
2019**Parameters**
2020
2021| Name| Description|
2022| -------- | -------- |
2023| response | ArkWeb_Response. |
2024| name | The name of a header. |
2025| value | The value of a header. This function allocates memory for the **value **string. You need to release the string using **OH_ArkWeb_ReleaseString**.|
2026
2027
2028### OH_ArkWebResponse_GetMimeType()
2029
2030```
2031void OH_ArkWebResponse_GetMimeType (const ArkWeb_Response * response, char ** mimeType )
2032```
2033**Description**
2034
2035Obtains the mime type of **ArkWeb_Response**.
2036
2037**System capability**: SystemCapability.Web.Webview.Core
2038
2039**Since**: 12
2040
2041**Parameters**
2042
2043| Name| Description|
2044| -------- | -------- |
2045| response | ArkWeb_Response. |
2046| mimeType | The mime type of **ArkWeb_Response**. This function allocates memory for the **mimeType** string. You need to release the string using **OH_ArkWeb_ReleaseString**.|
2047
2048
2049### OH_ArkWebResponse_GetStatus()
2050
2051```
2052int OH_ArkWebResponse_GetStatus (const ArkWeb_Response * response)
2053```
2054**Description**
2055
2056Obtains the HTTP status code of **ArkWeb_Response**.
2057
2058**System capability**: SystemCapability.Web.Webview.Core
2059
2060**Since**: 12
2061
2062**Parameters**
2063
2064| Name| Description|
2065| -------- | -------- |
2066| response | ArkWeb_Response. |
2067
2068**Returns**
2069
2070The HTTP status code of **ArkWeb_Response**. If **ArkWeb_Response** is invalid, the value is **-1**.
2071
2072
2073### OH_ArkWebResponse_GetStatusText()
2074
2075```
2076void OH_ArkWebResponse_GetStatusText (const ArkWeb_Response * response, char ** statusText )
2077```
2078**Description**
2079
2080Obtains the status text of **ArkWeb_Response**.
2081
2082**System capability**: SystemCapability.Web.Webview.Core
2083
2084**Since**: 12
2085
2086**Parameters**
2087
2088| Name| Description|
2089| -------- | -------- |
2090| response | ArkWeb_Response. |
2091| statusText | The status text of **ArkWeb_Response**. This function allocates memory for the **statusText** string. You need to release the string using **OH_ArkWeb_ReleaseString**.|
2092
2093
2094### OH_ArkWebResponse_GetUrl()
2095
2096```
2097void OH_ArkWebResponse_GetUrl (const ArkWeb_Response * response, char ** url )
2098```
2099**Description**
2100
2101Obtains the parsed URL that is redirected or changed due to HSTS.
2102
2103**System capability**: SystemCapability.Web.Webview.Core
2104
2105**Since**: 12
2106
2107**Parameters**
2108
2109| Name| Description|
2110| -------- | -------- |
2111| response | ArkWeb_Response. |
2112| url | The parsed URL.|
2113
2114
2115### OH_ArkWebResponse_SetCharset()
2116
2117```
2118int32_t OH_ArkWebResponse_SetCharset (ArkWeb_Response * response, const char * charset )
2119```
2120**Description**
2121
2122Sets the character set for **ArkWeb_Response**.
2123
2124**System capability**: SystemCapability.Web.Webview.Core
2125
2126**Since**: 12
2127
2128**Parameters**
2129
2130| Name| Description|
2131| -------- | -------- |
2132| response | ArkWeb_Response. |
2133| charset | The character set of a request. |
2134
2135**Returns**
2136
2137If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2138
2139
2140### OH_ArkWebResponse_SetError()
2141
2142```
2143int32_t OH_ArkWebResponse_SetError (ArkWeb_Response * response, ArkWeb_NetError errorCode )
2144```
2145**Description**
2146
2147Sets an error code for the **ArkWeb_Response** object.
2148
2149**System capability**: SystemCapability.Web.Webview.Core
2150
2151**Since**: 12
2152
2153**Parameters**
2154
2155| Name| Description|
2156| -------- | -------- |
2157| response | ArkWeb_Response. |
2158| errorCode | Error code of a failed request. |
2159
2160**Returns**
2161
2162If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2163
2164
2165### OH_ArkWebResponse_SetHeaderByName()
2166
2167```
2168int32_t OH_ArkWebResponse_SetHeaderByName (ArkWeb_Response * response, const char * name, const char * value, bool overwrite )
2169```
2170**Description**
2171
2172Sets a header for **ArkWeb_Response**.
2173
2174**System capability**: SystemCapability.Web.Webview.Core
2175
2176**Since**: 12
2177
2178**Parameters**
2179
2180| Name| Description|
2181| -------- | -------- |
2182| response | ArkWeb_Response. |
2183| name | The name of a header. |
2184| value | The value of a header. |
2185| overwirte | If the value is **true**, the existing header is overwritten. Otherwise, the existing header is not overwritten. |
2186
2187**Returns**
2188
2189If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2190
2191
2192### OH_ArkWebResponse_SetMimeType()
2193
2194```
2195int32_t OH_ArkWebResponse_SetMimeType (ArkWeb_Response * response, const char * mimeType )
2196```
2197**Description**
2198
2199Sets the mime type for **ArkWeb_Response**.
2200
2201**System capability**: SystemCapability.Web.Webview.Core
2202
2203**Since**: 12
2204
2205**Parameters**
2206
2207| Name| Description|
2208| -------- | -------- |
2209| response | ArkWeb_Response. |
2210| mimeType | The mime type of a request. |
2211
2212**Returns**
2213
2214If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2215
2216
2217### OH_ArkWebResponse_SetStatus()
2218
2219```
2220int32_t OH_ArkWebResponse_SetStatus (ArkWeb_Response * response, int status )
2221```
2222**Description**
2223
2224Sets an HTTP status code for the **ArkWeb_Response** object.
2225
2226**System capability**: SystemCapability.Web.Webview.Core
2227
2228**Since**: 12
2229
2230**Parameters**
2231
2232| Name| Description|
2233| -------- | -------- |
2234| response | ArkWeb_Response. |
2235| status | The HTTP status code of a request. |
2236
2237**Returns**
2238
2239If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2240
2241
2242### OH_ArkWebResponse_SetStatusText()
2243
2244```
2245int32_t OH_ArkWebResponse_SetStatusText (ArkWeb_Response * response, const char * statusText )
2246```
2247**Description**
2248
2249Sets the status text for **ArkWeb_Response**.
2250
2251**System capability**: SystemCapability.Web.Webview.Core
2252
2253**Since**: 12
2254
2255**Parameters**
2256
2257| Name| Description|
2258| -------- | -------- |
2259| response | ArkWeb_Response. |
2260| statusText | The status text of a request. |
2261
2262**Returns**
2263
2264If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2265
2266
2267### OH_ArkWebResponse_SetUrl()
2268
2269```
2270int32_t OH_ArkWebResponse_SetUrl (ArkWeb_Response * response, const char * url )
2271```
2272**Description**
2273
2274Sets the parsed URL that is redirected or changed due to HSTS. After the setting, redirection is triggered.
2275
2276**System capability**: SystemCapability.Web.Webview.Core
2277
2278**Since**: 12
2279
2280**Parameters**
2281
2282| Name| Description|
2283| -------- | -------- |
2284| response | ArkWeb_Response. |
2285| url | The parsed URL. |
2286
2287**Returns**
2288
2289If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2290
2291
2292### OH_ArkWebSchemeHandler_GetUserData()
2293
2294```
2295void* OH_ArkWebSchemeHandler_GetUserData (const ArkWeb_SchemeHandler * schemeHandler)
2296```
2297**Description**
2298
2299Obtains the user data from **ArkWeb_SchemeHandler**.
2300
2301**System capability**: SystemCapability.Web.Webview.Core
2302
2303**Since**: 12
2304
2305**Parameters**
2306
2307| Name| Description|
2308| -------- | -------- |
2309| schemeHandler | ArkWeb_SchemeHandler. |
2310
2311**Returns**
2312
2313Returns the user data.
2314
2315
2316### OH_ArkWebSchemeHandler_SetOnRequestStart()
2317
2318```
2319int32_t OH_ArkWebSchemeHandler_SetOnRequestStart (ArkWeb_SchemeHandler * schemeHandler, ArkWeb_OnRequestStart onRequestStart )
2320```
2321**Description**
2322
2323Sets an **OnRequestStart** callback for **SchemeHandler**.
2324
2325**System capability**: SystemCapability.Web.Webview.Core
2326
2327**Since**: 12
2328
2329**Parameters**
2330
2331| Name| Description|
2332| -------- | -------- |
2333| schemeHandler | The **SchemeHandler** for this scheme. |
2334| onRequestStart | The callback function **OnRequestStart**. |
2335
2336**Returns**
2337
2338If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2339
2340
2341### OH_ArkWebSchemeHandler_SetOnRequestStop()
2342
2343```
2344int32_t OH_ArkWebSchemeHandler_SetOnRequestStop (ArkWeb_SchemeHandler * schemeHandler, ArkWeb_OnRequestStop onRequestStop )
2345```
2346**Description**
2347
2348Sets an **OnRequestStop** callback for **SchemeHandler**.
2349
2350**System capability**: SystemCapability.Web.Webview.Core
2351
2352**Since**: 12
2353
2354**Parameters**
2355
2356| Name| Description|
2357| -------- | -------- |
2358| schemeHandler | The **SchemeHandler** for this scheme. |
2359| onRequestStop | The callback function **OnRequestStop**. |
2360
2361**Returns**
2362
2363If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2364
2365
2366### OH_ArkWebSchemeHandler_SetUserData()
2367
2368```
2369int32_t OH_ArkWebSchemeHandler_SetUserData (ArkWeb_SchemeHandler * schemeHandler, void * userData )
2370```
2371**Description**
2372
2373Sets a user data to the **ArkWeb_SchemeHandler** object.
2374
2375**System capability**: SystemCapability.Web.Webview.Core
2376
2377**Since**: 12
2378
2379**Parameters**
2380
2381| Name| Description|
2382| -------- | -------- |
2383| schemeHandler | ArkWeb_SchemeHandler. |
2384| userData | The user data to be set. |
2385
2386**Returns**
2387
2388If **0** is returned, the operation is successful. If **17100101** is returned, the parameter is invalid.
2389
2390
2391### OH_ArkWebServiceWorker_ClearSchemeHandlers()
2392
2393```
2394int32_t OH_ArkWebServiceWorker_ClearSchemeHandlers ()
2395```
2396**Description**
2397
2398Clears the **SchemeHandler** registered for **ServiceWorker**.
2399
2400**System capability**: SystemCapability.Web.Webview.Core
2401
2402**Since**: 12
2403
2404**Returns**
2405
2406If the operation is successful, **0** is returned; otherwise, an error code is returned.
2407
2408
2409### OH_ArkWebServiceWorker_SetSchemeHandler()
2410
2411```
2412bool OH_ArkWebServiceWorker_SetSchemeHandler (const char * scheme, ArkWeb_SchemeHandler * schemeHandler )
2413```
2414**Description**
2415
2416Sets an **ArkWeb_SchemeHandler** for a specified scheme to intercept requests of this scheme triggered by **ServiceWorker**.
2417
2418The **SchemeHandler** should be set after **BrowserContext** is created.
2419
2420You can use **WebviewController.initializeWebEngine** to initialize **BrowserContext** without creating the ArkWeb component.
2421
2422**System capability**: SystemCapability.Web.Webview.Core
2423
2424**Since**: 12
2425
2426**Parameters**
2427
2428| Name| Description|
2429| -------- | -------- |
2430| scheme | The scheme to be intercepted. |
2431| schemeHandler | The **ArkWeb_SchemeHandler** for this scheme. Only requests triggered by the **ServiceWorker** are notified through this **schemeHandler**. |
2432
2433**Returns**
2434
2435If the **SchemeHandler** is successfully set for the specified scheme, **true** is returned. Otherwise, **false** is returned.
2436
2437
2438### OH_NativeArkWeb_GetDestroyCallback()
2439
2440```
2441NativeArkWeb_OnDestroyCallback OH_NativeArkWeb_GetDestroyCallback (const char * webTag)
2442```
2443**Description**
2444
2445Obtains the callback used when a registered component is destroyed.
2446
2447**System capability**: SystemCapability.Web.Webview.Core
2448
2449**Since**: 11
2450
2451**Parameters**
2452
2453| Name| Description|
2454| -------- | -------- |
2455| webTag | The name of a **Web** component. |
2456
2457**Returns**
2458
2459Returns the callback used when a registered component is destroyed.
2460
2461
2462### OH_NativeArkWeb_GetJavaScriptProxyValidCallback()
2463
2464```
2465NativeArkWeb_OnValidCallback OH_NativeArkWeb_GetJavaScriptProxyValidCallback (const char * webTag)
2466```
2467**Description**
2468
2469Obtains the callback used when a registered object is valid.
2470
2471**System capability**: SystemCapability.Web.Webview.Core
2472
2473**Since**: 11
2474
2475**Parameters**
2476
2477| Name| Description|
2478| -------- | -------- |
2479| webTag | The name of a **Web** component. |
2480
2481**Returns**
2482
2483Returns the callback used when a registered object is valid.
2484
2485
2486### OH_NativeArkWeb_RegisterJavaScriptProxy()
2487
2488```
2489void OH_NativeArkWeb_RegisterJavaScriptProxy (const char * webTag, const char * objName, const char ** methodList, NativeArkWeb_OnJavaScriptProxyCallback * callback, int32_t size, bool needRefresh )
2490```
2491**Description**
2492
2493Lists the registered objects and function names.
2494
2495**System capability**: SystemCapability.Web.Webview.Core
2496
2497**Since**: 11
2498
2499**Parameters**
2500
2501| Name| Description|
2502| -------- | -------- |
2503| webTag | The name of a **Web** component. |
2504| objName | The name of the injected object. |
2505| methodList | The name of the injected function list. |
2506| callback | The injected callback function. |
2507| size | The number of the injected callback functions. |
2508| needRefresh | Whether a page need to be refreshed.|
2509
2510
2511### OH_NativeArkWeb_RunJavaScript()
2512
2513```
2514void OH_NativeArkWeb_RunJavaScript (const char * webTag, const char * jsCode, NativeArkWeb_OnJavaScriptCallback callback )
2515```
2516**Description**
2517
2518Runs a piece of JavaScript code in the displaying page.
2519
2520**System capability**: SystemCapability.Web.Webview.Core
2521
2522**Since**: 11
2523
2524**Parameters**
2525
2526| Name| Description|
2527| -------- | -------- |
2528| webTag | The name of a **Web** component. |
2529| jsCode | A piece of JavaScript code script. |
2530| callback | The callback used to notify the result after code is executed.|
2531
2532
2533### OH_NativeArkWeb_SetDestroyCallback()
2534
2535```
2536void OH_NativeArkWeb_SetDestroyCallback (const char * webTag, NativeArkWeb_OnDestroyCallback callback )
2537```
2538**Description**
2539
2540Sets a callback used when a component is destroyed.
2541
2542**System capability**: SystemCapability.Web.Webview.Core
2543
2544**Since**: 11
2545
2546**Parameters**
2547
2548| Name| Description|
2549| -------- | -------- |
2550| webTag | The name of a **Web** component. |
2551| callback | The callback used when a component is destroyed.|
2552
2553
2554### OH_NativeArkWeb_SetJavaScriptProxyValidCallback()
2555
2556```
2557void OH_NativeArkWeb_SetJavaScriptProxyValidCallback (const char * webTag, NativeArkWeb_OnValidCallback callback )
2558```
2559**Description**
2560
2561Sets a callback used when an object is valid.
2562
2563**System capability**: SystemCapability.Web.Webview.Core
2564
2565**Since**: 11
2566
2567**Parameters**
2568
2569| Name| Description|
2570| -------- | -------- |
2571| webTag | The name of a **Web** component. |
2572| callback | The callback used when an object is valid.|
2573
2574
2575### OH_NativeArkWeb_UnregisterJavaScriptProxy()
2576
2577```
2578void OH_NativeArkWeb_UnregisterJavaScriptProxy (const char * webTag, const char * objName )
2579```
2580**Description**
2581
2582Deletes a registered object and its callback.
2583
2584**System capability**: SystemCapability.Web.Webview.Core
2585
2586**Since**: 11
2587
2588**Parameters**
2589
2590| Name| Description|
2591| -------- | -------- |
2592| webTag | The name of a **Web** component. |
2593| objName | The name of the injected object.|
2594
2595### OH_NativeArkWeb_LoadData()
2596
2597```
2598ArkWeb_ErrorCode OH_NativeArkWeb_LoadData (const char* webTag,const char* data,const char* mimeType,const char* encoding,const char* baseUrl,const char* historyUrl)
2599```
2600**Description**
2601
2602Loads data or URLs. This function must be called in the main thread.
2603
2604**System capability**: SystemCapability.Web.Webview.Core
2605
2606**Since**: 15
2607
2608**Parameters**
2609
2610| Name | Description |
2611| -------- | -------- |
2612| webTag | The name of a **Web** component.  |
2613| data   | String being base64 or URL encoded, which cannot be empty.  |
2614| mimeType  | Media type, such as **text/html**, which cannot be empty.  |
2615| encoding  | Encoding type, such as **UTF-8**, which cannot be empty.  |
2616| baseUrl   | URL (HTTP/HTTPS/data compliant), which is assigned by the **Web** component to **window.origin**.  |
2617| historyUrl  | Historical URL. If this parameter is not empty, it can be managed in historical records to implement page going backward and forward.  |
2618
2619
2620**Returns**
2621
2622Error codes of ArkWeb NDK APIs.
2623
2624<!--no_check-->