Raven B4
  • Main Page
  • Guide
    • Setup
    • Examples
  • Documentation
    • imports
    • events
    • client
    • entity
    • network
    • world
    • render
    • gl
    • modules
    • config
    • keybinds
    • inventory
    • tile entity
    • util
    • bridge
    • http
    • json
    • packets
    • objects
Powered by GitBook
On this page
  • loadstring
  • request
  • addHeader
  • setUserAgent
  • setConnectionTimeout
  • setReadTimeout
  • setContent
  • fetch
  • code
  • string
  • json
  1. Documentation

http

loadstring

load - "URL"

Loads and compiles code from an external website. Must be outside of a function in the documented format on a separate line.

request

Request request = new Request(String method, String URL);

Creates a new request to a specified URL. Supported methods: "GET", "POST".

addHeader

request.addHeader(String header, String value);

Adds a header to the request.

setUserAgent

request.setUserAgent(String userAgent);

Sets the User-Agent header for the request.

setConnectionTimeout

request.setConnectTimeout(int timeout);

Sets the connection timeout for the request.

setReadTimeout

request.setReadTimeout(int timeout);

Sets the read timeout for the request.

setContent

request.setContent(String content);

Sets the content to be sent with a POST request.

fetch

Response response = request.fetch();

Executes the request.

code

int code = response.code();

Returns the response code for a request.

string

String string = response.string();

Returns the data from a request as a string.

json

Json json = response.json();

Returns the data from a request as json.

Last updated 5 months ago