flix

0.70.0

Net.HttpLayer

Definitions

def bytesToString(v: Vector[Int8]): String Source

Decodes the byte vector v as a UTF-8 string.

def doRequest(defaultClient: java.net.http.HttpClient, req: HttpRequest): Result[IoError, HttpResponse] \ IO Source

Performs the actual HTTP request using the Java HTTP client.

Reuses defaultClient when the request has default client-level settings (connectTimeout == None and followRedirects == true). Otherwise, builds a one-off client with the request's specific settings.

def execute(validate: HttpRequest -> Result[IoError, Unit], defaultClient: java.net.http.HttpClient, req: HttpRequest): Result[IoError, HttpResponse] \ IO Source

Validates then performs an HTTP request.

def newDefaultClient(): java.net.http.HttpClient \ IO Source

Builds a default HttpClient with Redirect.NORMAL and no connect timeout.

def sleep(ms: Int64): Unit \ IO Source

Sleeps the current thread for ms milliseconds.

def stringToBytes(s: String): Vector[Int8] Source

Encodes the string s as a UTF-8 byte vector.

def urlEncode(s: String): String Source

Returns the URL-encoded form of the string s.