Skip to content

Conversation

@abdussalam-alali
Copy link

What?

Generic API Client

Why?

In order to access the non-resource API end-points, we can create a js file inside the API folder as a custom client.
using this file we can access endpoints directly by their URL and pass data.

How?

Create an instance of GenericRequest then call one of the following methods:

  • get(url, params) // HTTP GET Request
  • post(url, data) // HTTP POST Request
  • put(url, data) // HTTP PUT Request
  • delete(url) // HTTP DELETE Request
  • postWithId(url, id, data) // HTTP POST Request "/url/id"
  • putWithId(url,id,data) // HTTP PUT Request "/url/id"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant