OSRS Plugin API
    Preparing search index...

    Namespace HTTP

    This section is for HTTP, or hypertext transfer protocol, binding. This can be used to transfer information between a client and a server. As an example all website links are HTTP’s, allowing your computer to get access and information from the website's server.

    When creating an HTTP request, or requesting information from an outside source, there are a few things we can do.

    First, we must make the request to a specified URL (uniform resource locator) endpoint, which is the internet address of a website. As an example, this would be the text that brings you to a website that starts with “http” found at the top of a web browser. This will be referred to as the targetURL. Most of the time you will be using Web API’s, something like this site, for this section.

    Next, we need to let the server know what type of request we are making. There are two different types of requests: GET (receives data from the URL) or POST (sends data to the URL). These can be found under RequestType.

    After that everything else becomes optional.

    Query parameters is information we provide to the URL endpoint. This can be information like a specific ID, a key, or anything else that might be needed. This information is normally used when we are creating a GET request, where we send data (like an NPC ID) to get more information about that specific NPC, such as its name.

    Headers specify how the request should behave, such as the type of information it should look at and gather. This is basically like giving your request rules on how it should act.

    Callback is a function that you can make that will run directly after the request is finished. It will be given the HTTP code and whatever data the request gained.

    And finally the dataType and body work together to determine how POST requests should be sent. Imagine you have data you want to send to a website, like an NPCs name, but you only want the information to be sent in a specific way. The dataType (which uses BodyType) and the body will help make sure that is possible.

    All together these will make it so that your plugin is able to send and receive data from outside URLs.

    Enumerations

    BodyType
    RequestType

    Functions

    request