parseResponseFormData()function

parseResponseFormData(response: Response, caller: AnyCaller = parseResponseFormData): Promise<FormData>
ParamType
responseResponse
The Response whose form-data body to parse. required
callerAnyCaller
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);