The Request object is returned when calling the api()
method on a model. This object is the foundation for Vuex ORM Axios and enables you to call many of the supported axios methods to perform an API request. Any Custom Actions will also be defined on the Request object.
You can call request methods directly through chaining.
# Constructorconstructor(model: typeof Model)
By default, calling the api()
method on a model will attach the model class to the Request object.
You may also create a Request instance by passing a model as the constructors only param.
model
Type: typeof Model
The model class that is attached to the Request instance.
axios
Type: AxiosInstance
The axios instance that will be used to perform the request.
get
get(url: string, config: Config = {}): Promise<Response>
Performs a GET
request. It takes the same arguments as the axios get
method.
post
post(url: string, data: any = {}, config: Config = {}): Promise<Response>
Performs a POST
request. It takes the same arguments as the axios post
method.
put
put(url: string, data: any = {}, config: Config = {}): Promise<Response>
Performs a PUT
request. It takes the same arguments as the axios put
method.
patch
patch(url: string, data: any = {}, config: Config = {}): Promise<Response>
Performs a PATCH
request. It takes the same arguments as the axios patch
method.
delete
delete(url: string, config: Config = {}): Promise<Response>
Performs a DELETE
request. It takes the same arguments as the axios delete
method.
request
request(config: Config): Promise<Response>
Performs a request with the given config options. Requests will default to GET
if the method
option is not specified.
All request aliases call this method by merging the relevant configs. You may use this method if you are more familiar with using the axios API in favour of alias methods.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4