12345678910111213141516171819202122232425262728293031323334353637383940 |
- package api
- import "net/http"
- func (api *Client) Get(
- u string,
- result interface{},
- ) error {
- params := RequestOptions{
- Method: http.MethodGet,
- Headers: makeHeaders(api.options.AccessToken),
- }
- return api.doRequest(u, params, result)
- }
- func (api *Client) Post(
- u string,
- request any,
- result any,
- ) error {
- params := RequestOptions{
- Method: http.MethodPost,
- Body: request,
- Headers: makeHeaders(api.options.AccessToken),
- }
- return api.doRequest(u, params, result)
- }
- func (api *Client) Patch(
- u string,
- request any,
- result any,
- ) error {
- params := RequestOptions{
- Method: http.MethodPatch,
- Body: request,
- Headers: makeHeaders(api.options.AccessToken),
- }
- return api.doRequest(u, params, result)
- }
|