HTTP testing: file uploads and binary responses

HTTP tests can upload files as multipart bodies, send and download binary content, and set a typed httpConfig.

@donobu/donobu-http-testing 1.11.0 and 1.12.0 handle files.

await request.call({
  method: 'POST',
  url: '/reports',
  multipart: {
    title: 'Q3',
    report: { path: 'fixtures/q3.pdf' },
  },
});
  • multipart bodies from code and from request.ai; request.ai can upload only files inside the project folder
  • Binary bodies are sent and read whole: response.bytes and response.save()
  • A binary body is recorded only as its type, size and hash, never its bytes
  • A typed httpConfig option in the Playwright config