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