#2786·crawlee

AddRequest should support binary Buffer payload

Author: Gilc83Created Dec 30, 2024Updated Sep 18, 2026
Labelsfeaturet-tooling

Which package is the feature request for? If unsure which one to select, leave blank

@crawlee/core

Feature

I'm trying to submit HTTP POST requests and add them directly to the queue, but when adding a request like this: let response = await requestQueue.addRequest({ url: interceptedUrl, method: method, payload: postData, ...

The payload parameter accepts only string postData, and not a Buffer, while in multipart file upload scenarios, the uploaded file can be a binary one, requiring the payload to be either a string or a Buffer.

Motivation

I'm using Crawlee to write a web spider, including file upload and it is not supported.

Ideal solution or implementation, and any additional constraints

Just change the type of payload to string, undefined or Buffer, and support Buffer along the way. At least in Playwright who also supports it.

Alternative solutions or implementations

No response

Other context

No response