Skip to content

Commit

Permalink
improve request docs, as per mollie#358 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke committed Sep 10, 2024
1 parent e0604dd commit 934a6d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/communication/NetworkClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ interface Context {}
* This class is essentially a wrapper around fetch. It simplifies communication with the Mollie API over the network.
*/
export default class NetworkClient {
/**
* Triggers a request to the Mollie API.
*
* In contrast to the underlying `fetch` function, this function will:
* - retry the request in some scenarios (see `retryingFetch`)
* - throw an `ApiError` if the response from the Mollie API indicates an error
* - appropriately process the response body before returning it (i.e. parsing it as JSON or throwing an ApiError if the response status indicates an error)
*/
protected readonly request: (pathname: string, options?: RequestInit) => Promise<any>;
constructor({
apiKey,
Expand Down

0 comments on commit 934a6d9

Please sign in to comment.