Bodge.app

global http

Make outbound HTTP requests


methods


M.request


function M.request(req: HttpRequest {
    method = string,
    url = string,
    params = table,
    headers = table,
    body = string,
}) ->  HttpResponse {
    statuscode = integer,
    headers = table,
    body = string,
}

Base method for making HTTP requests.

M.qsencode


function M.qsencode(t: table) -> string qs

Encode a querystring from a list of pairs.

You shouldn't need this in most cases, http.request takes a query parameter that will do this for you.

M.qsdecode


function M.qsdecode(qs: string) ->  table

Decode a list of pairs from a querystring.

You shouldn't need this in most cases, http responses have the query field that will do this for you.