In these steps, we are going to create the HTTP GET method. Follow each of the following instructions to create the getHttp function:
- Create a constant called getHttp.
- Define that constant as an asynchronous function that receives three arguments, url, type, and options. The type argument will have the default value of 'json'.
- In this function return, we will execute the baseHttp function, passing the url that we received, 'get' as the second argument, the options as the third argument, and immediately execute the function with the type argument we received:
export const getHttp = async (url, type = 'json', options) => (await
baseHttp(url, 'get', options))(type);