Add method comments for request headers
This commit is contained in:
parent
30aaff2572
commit
04358856b5
|
@ -71,6 +71,7 @@ namespace MastodonAPI {
|
|||
* GET request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Query parameters
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async get<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -115,6 +116,7 @@ namespace MastodonAPI {
|
|||
* PUT request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data. If you want to post file, please use FormData()
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async put<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -158,6 +160,7 @@ namespace MastodonAPI {
|
|||
* PATCH request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data. If you want to post file, please use FormData()
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async patch<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -201,6 +204,7 @@ namespace MastodonAPI {
|
|||
* POST request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async post<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -235,6 +239,7 @@ namespace MastodonAPI {
|
|||
* DELETE request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async del<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
|
|
@ -456,6 +456,7 @@ namespace MisskeyAPI {
|
|||
* POST request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async post<T>(path: string, params: any = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
|
|
@ -271,6 +271,7 @@ namespace PleromaAPI {
|
|||
* GET request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Query parameters
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async get<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -315,6 +316,7 @@ namespace PleromaAPI {
|
|||
* PUT request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data. If you want to post file, please use FormData()
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async put<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -358,6 +360,7 @@ namespace PleromaAPI {
|
|||
* PATCH request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data. If you want to post file, please use FormData()
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async patch<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -401,6 +404,7 @@ namespace PleromaAPI {
|
|||
* POST request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async post<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
@ -435,6 +439,7 @@ namespace PleromaAPI {
|
|||
* DELETE request to mastodon REST API.
|
||||
* @param path relative path from baseUrl
|
||||
* @param params Form data
|
||||
* @param headers Request header object
|
||||
*/
|
||||
public async del<T>(path: string, params = {}, headers: { [key: string]: string } = {}): Promise<Response<T>> {
|
||||
let options: AxiosRequestConfig = {
|
||||
|
|
Loading…
Reference in a new issue