curl2ab icon indicating copy to clipboard operation
curl2ab copied to clipboard

support headers

Open Pranav2612000 opened this issue 2 years ago • 2 comments

Pranav2612000 avatar May 02 '23 15:05 Pranav2612000

Can you be more specific on headers you need ?

There is currently all of these headers that are copied:

    "origin",
    "authorization",
    "accept",
    "cookie",
    "user-agent",
    "accept-encoding",
    "accept-language",
    "upgrade-insecure-requests",
    "x-api-token"

ahivert avatar May 25 '23 20:05 ahivert

This should be dynamic and iterative. And not limited to a set of predefined headers.

A sample curl could look like this

curl --location --request POST 'https://abc.net/webhook/abc' \ --header 'accept: application/json' \ --header 'api-key-header: aa@1234' \ --header 'Content-Type: application/json' \ --header 'testbytanay: thisisasamplekey' \ --data-raw '{ "firstname": "Tanay", "lastname": "Sai", "phone" : "xxxx", "email": "[email protected]" }'

It should be able to translate the above into the required ab command. Same applies to data-raw. (Someone has logged a separatte issue for data-raw.

Without these 2 capabilities, this tool has not much of value

saitanay avatar Jun 14 '23 03:06 saitanay

all headers are now copied from curl to ab (already deployed). For data-raw, it's a bit more complex, as ab require creating a file containing the data to send. To keep simple command, ab must be replaced with another tool like hey

ahivert avatar Apr 26 '24 05:04 ahivert