Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a generic API client #315

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant