Space Station 13 - Modules - TypesVar Details - Proc Details

HTTP Request

Holder datum for ingame HTTP requests

Holds information regarding to methods used, URL, and response, as well as job IDs and progress tracking for async requests

Vars

_raw_responseThe raw response, which will be decoeded into a /datum/http_response
bodyBody of the request being sent
cbCallback for executing after async requests. Will be called with an argument of /datum/http_response as first argument
headersRequest headers being sent
idThe ID of the request (Only set if it is an async request)
in_progressIs the request in progress? (Only set if it is an async request)
methodHTTP method used
output_fileIf present, response body will be saved to this file.
urlURL that the request is being sent to

Procs

begin_asyncAsync execution starter
build_optionsOptions builder
execute_blockingBlocking executor
into_responseResponse deserializer
is_completeAsync completion checker
preparePreparation handler

Var Details

_raw_response

The raw response, which will be decoeded into a /datum/http_response

body

Body of the request being sent

cb

Callback for executing after async requests. Will be called with an argument of /datum/http_response as first argument

headers

Request headers being sent

id

The ID of the request (Only set if it is an async request)

in_progress

Is the request in progress? (Only set if it is an async request)

method

HTTP method used

output_file

If present, response body will be saved to this file.

url

URL that the request is being sent to

Proc Details

begin_async

Async execution starter

Tells the request to start executing inside its own thread inside RUSTG Preferred over blocking, but also requires SShttp to be active As such, you cannot use this for events which may happen at roundstart (EG: IPIntel, BYOND account tracking, etc)

build_options

Options builder

Builds options for if we want to download files with SShttp

execute_blocking

Blocking executor

Remains as a proof of concept to show it works, but should NEVER be used to do FFI halting the entire DD process up Async rqeuests are much preferred, but also require the subsystem to be firing for them to be answered

into_response

Response deserializer

Takes a HTTP request object, and converts it into a /datum/http_response The entire thing is wrapped in try/catch to ensure it doesnt break on invalid requests Can be called on async and blocking requests

is_complete

Async completion checker

Checks if an async request has been complete Has safety checks built in to compensate if you call this on blocking requests, or async requests which have already finished

prepare

Preparation handler

Call this with relevant parameters to form the request you want to make

Arguments: