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