API Reference › Http › Http.open
method

Http.open

Http.open(method, url) -> int

Opens a request without sending it, so headers and a body can be added first with Http.set / Http.body, then dispatched with Http.send.

Example

program Demo {
  entry {
    let h = Http.open("POST", "https://example.com/api")
    Http.set(h, "Authorization", "Bearer token")
    Http.body(h, "{}")
    Http.send(h)
  }
}
← All symbols