parseResponseFormData()function
parseResponseFormData(response: Response, caller: AnyCaller = parseResponseFormData): Promise<FormData>
| Param | Type | |
|---|---|---|
response | Response | The Response whose form-data body to parse. required |
caller | AnyCaller | Identity of the calling function for error attribution. Defaults to parseResponseFormData |
| Return | |
|---|---|
Promise<FormData> | The parsed FormData. |
| Throws | |
|---|---|
ResponseError | If the response body is not valid multipart form-data. |
Parse FormData from an HTTP Response, or return undefined when the response has no body.
Examples
const form = await parseResponseFormData(response);