The HTTP method e.g. "GET".
The HTTP path after the supplied prefix e.g. "/createRoom".
A dict of query params (these will NOT be urlencoded). If unspecified, there will be no query params.
Optionalbody: Body
The HTTP JSON body.
additional options.
When paramOpts.doNotAttemptTokenRefresh is true, token refresh will not be attempted
when an expired token is encountered. Used to only attempt token refresh once.
The parsed response.
Form and return a homeserver request URL based on the given path params and prefix.
The HTTP path after the supplied prefix e.g. "/createRoom".
OptionalqueryParams: QueryDict
A dict of query params (these will NOT be urlencoded).
Optionalprefix: string
The full prefix to use e.g. "/_matrix/client/v2_alpha", defaulting to this.opts.prefix.
OptionalbaseUrl: string
The baseUrl to use e.g. "https://matrix.org", defaulting to this.opts.baseUrl.
URL
Perform a request to the homeserver without any credentials.
The HTTP method e.g. "GET".
The HTTP path after the supplied prefix e.g. "/createRoom".
OptionalqueryParams: QueryDict
A dict of query params (these will NOT be urlencoded). If unspecified, there will be no query params.
Optionalbody: Body
The HTTP JSON body.
Optionalopts: IRequestOpts
additional options
The parsed response.
Attempt to revoke the current access and refresh tokens with the OAuth2 authorization server, e.g. as
part of logging out an OAuth2-native session. Does nothing if opts.oauth2ClientConfig was not supplied.
Sets the base URL for the identity server
Optionalurl: string
The new base url
ProtectedwithPerform an authenticated request, ensuring that the access token is fresh before it is made, and
refreshing the token and retrying the request if it fails with M_UNKNOWN_TOKEN.
Emits HttpApiEvent.SessionLoggedOut and HttpApiEvent.NoConsent as appropriate.
performs the request using the given access token, and rejects with a MatrixError if the homeserver returns an error. May be called more than once.
OptionalinhibitLogoutEmit: boolean
if true, HttpApiEvent.SessionLoggedOut will not be emitted.
the number of attempts made so far, including this one. Used to back off between token refresh attempts.
the result of request.
Perform an authorised request to the homeserver.