Skip to content

Instantly share code, notes, and snippets.

@fridezlucas
Last active November 2, 2021 20:16
Show Gist options
  • Select an option

  • Save fridezlucas/f6b36a169291f83c7faaca8975228191 to your computer and use it in GitHub Desktop.

Select an option

Save fridezlucas/f6b36a169291f83c7faaca8975228191 to your computer and use it in GitHub Desktop.
Medium TypeScript GET+ POST RESTful client - IApiClient
interface ApiClient {
instance(): ApiClient;
get<T>(url: string): Promise<T>;
post<T>(url: string, body: any): Promise<T>;
put<T>(url: string, body: any): Promise<T>;
patch<T>(url: string, body: any): Promise<T>;
delete<T>(url: string): Promise<T>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment