Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is default header content-type for http post method in curl form? [duplicate]

I am using a curl command with POST method using html Form with attribute- values. I am using flask framework. My content type is not application-json.

The command I give with the headers is as follows:

curl -b cookies.txt -F "description=description" -F "file_name=@curl_commands.md"  -X POST http://localhost:5000/api/v1.0/upload_doc
-H 'workflow_id:1' -H 'change_workflow:Y'

What should I specify for the Content-type:? This is required for the js ajax call.

like image 224
user956424 Avatar asked Jun 09 '16 06:06

user956424


People also ask

What is Content-Type in curl command?

Curl Content-Type Syntax Where: -H, —header: the HTTP header with which contains the data type for the data in the request body. d, —data: data to send to server using POST, PUT, or PATCH request.

How do you do a POST request in curl?

When the -F option is used, curl sends the data using the multipart/form-data Content-Type. Another way to make a POST request is to use the -d option. This causes curl to send the data using the application/x-www-form-urlencoded Content-Type.

What is Content-Type in POST request?

Content-Type in HTML forms In a POST request, resulting from an HTML form submission, the Content-Type of the request is specified by the enctype attribute on the <form> element.

What is curl post?

Updated February 23, 2021 | Published April 4, 2019. cURL, which stands for client URL, is a command line tool that developers use to transfer data to and from a server. At the most fundamental, cURL lets you talk to a server by specifying the location (in the form of a URL) and the data you want to send.


1 Answers

The answer is clear at this url: application/x-www-form-urlencoded or multipart/form-data

like image 55
user956424 Avatar answered Oct 22 '22 04:10

user956424