Module ark_api::http_request

source ·
Expand description

📡 HTTP Request API

API to be able to issue HTTP GET, POST, PUT, DELETE, PATCH requests.

This is useful and powerful to be able to access and communicate with local or internet services.

Security note

Currently there are no limitations on what domains and services can be accessed. But this will change later as more of the Ark capability-based security gets put into place and where modules have to opt-in and request access to minimal possible specific domains and URLs.

To prepare for this, avoid connecting to arbitrary URLs or allow user input of what to connect to when possible. Prefer domains and URLs the module can know statically at compile time, as it may need to declare them in its manifest later to get access to it.

Example usage

require_http_request_api!();

// Get Google's frontpage
let html_bytes = http_get(Url::Static("https://google.com")).unwrap();

Structs

  • HTTP response object sent back from a server.

Enums

  • HTTP request method
  • URL for HTTP requests

Functions

Type Definitions