* Sends an HTTP request * @param {string} resourcePath path of the request * @param {Object} [options] values to publish * @param {'PUT' | 'POST' | 'GET' | 'DELETE' | 'PATCH'} [options.method] the request method * @param {Object. } [options.headers] the request headers * @param {
(resourcePath, options)
| 70 | * @returns {import('@aws-appsync/utils').HTTPRequest} the request |
| 71 | */ |
| 72 | function fetch(resourcePath, options) { |
| 73 | const { method = 'GET', headers, body: _body, query } = options; |
| 74 | const body = typeof _body === 'object' ? JSON.stringify(_body) : _body; |
| 75 | return { |
| 76 | resourcePath, |
| 77 | method, |
| 78 | params: { headers, query, body }, |
| 79 | }; |
| 80 | } |
no outgoing calls
no test coverage detected