Documentation ¶
Overview ¶
The rbxweb package provides an interface to many of ROBLOX's web-based services.
Index ¶
- Variables
- type Client
- func (client *Client) AssertResp(resp *http.Response, err error) error
- func (client *Client) DoRawPost(page string, params url.Values) (err error)
- func (client *Client) GetCSRFToken() (string, error)
- func (client *Client) GetSecureURL(subdomain string, path string, query url.Values) (url string)
- func (client *Client) GetURL(subdomain string, path string, query url.Values) (url string)
- func (client *Client) Login(username string, password string) (err error)
- func (client *Client) Logout() (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrLoggedIn = errors.New("client is already logged in")
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client embeds a http.Client, and is used with every function that makes a request.
BaseDomain is the URL domain to which all requests will be sent. Subdomains are handled automatically as a part of API requests. Alternative domains, such as gametest, follow a scheme that makes switching domains easier:
BaseDomain: With subdomain: roblox.com --> www.roblox.com gametest.robloxlabs.com --> www.gametest.robloxlabs.com
func (*Client) AssertResp ¶
AssertResp checks whether a HTTP response errored. Also errors if the response has a non-2XX status code.
func (*Client) DoRawPost ¶
DoRawPost is a lower-level function that allows the user to perform a context-based HTML form POST for a given webpage. On Roblox, many older types of requests require a validation token, which is sent along with the page when viewing it. Many requests are also context-based. That is, manipulation of an item requires knowledge of how the item is displayed on the page.
When DoRawPost is called, a GET request is first sent to the page, then the validation tokens are parsed from the response and added as POST parameters automatically.
The values in `params` are used as the parameters for the POST request. If a value is empty, then the value is retrieved from the original GET response body, in the same way as the validation tokens. Values are retrieved by matching the key with the name attribute of any input tags found in the GET response body.
`page` must be a full URL, including query values, if required.
Whether the client needs to be logged in varies depending on the request.
func (*Client) GetCSRFToken ¶
func (*Client) GetSecureURL ¶
GetSecureURL is similar to GetURL, but it uses HTTPS instead of HTTP.
func (*Client) GetURL ¶
GetURL constructs a URL using BaseDomain and the given arguments, with HTTP as the protocol.
If `subdomain` is not empty, then it is added as the subdomain before the base domain. `path` is the part of the URL that appears after the base domain. If `query` is not nil, then it is encoded into query parameters and added to the end of the URL.
Directories ¶
Path | Synopsis |
---|---|
Deals with services related to ROBLOX assets.
|
Deals with services related to ROBLOX assets. |
Deals with services related to the ROBLOX catalog.
|
Deals with services related to the ROBLOX catalog. |
Deals with services related to ROBLOX groups.
|
Deals with services related to ROBLOX groups. |
Deals with services related to ROBLOX sets.
|
Deals with services related to ROBLOX sets. |
Deals with services related to users.
|
Deals with services related to users. |