N
N
Ne7Le4Der2022-01-31 15:25:42
Node.js
Ne7Le4Der, 2022-01-31 15:25:42

How to execute this curl with axios?

There is this curl:

curl -X 'POST' 'http://127.0.0.1/?conf%3D%7B%22flag%22%3A%20%22true%22%7D' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F '[email protected]' --output 'arch.zip'


I need to execute the same request but with axios while there is this code

const fd = new FormData();

fd.append('in_video', fileBuffer);

axios({
            method: 'post',
            url: 'http://127.0.0.1/',
            params: {
                 conf: {"flag": "true"}
            },
            headers: {
                'Content-Type': 'multipart/form-data'
            },
            data: fd,
        }).then(response =>console.log(response))
        .catch(error => console.log(error));


I don't really understand how to implement the --output 'arch.zip' flag

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid Yakovlev, 2022-01-31
@deleo547

curlconverter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question