Bokep
- Viewed 4.2m times5572edited Mar 29, 2023 at 18:43
You need to set your content-type to application/json. But -d (or --data) sends the Content-Type application/x-www-form-urlencoded by default, which is not accepted on Spring's side.
Looking at the curl man page, I think you can use -H (or --header):
-H "Content-Type: application/json"Full example:
curl --header "Content-Type: application/json" \--request POST \--data '{"username":"xyz","password":"xyz"}' \http://localhost:3000/api/login(-H is short for --header, -d for --data)
Note that -request POST is optional if you use -d, as the -d flag implie...
Content Under CC-BY-SA license rest - How do I POST JSON data with cURL? - Stack …
curl --header "Content-Type: application/json" \ --request POST \ --data '{"username":"xyz","password":"xyz"}' \ http://localhost:3000/api/login. (-His short for --header, -dfor --data) Note that -request POSTis optionalif you use -d, as …
JSON - everything curl
How to Post JSON Data using Curl - GeeksforGeeks
Apr 25, 2024 · One of the simplest way to post JSON data with cURL using the ‘-d’ or ‘–data’ flag followed by the JSON payload enclosed in single quotes. This method sends the data in the request and is suitable for most use cases.
- Question & Answer
How to PUT a json object with an array using curl
How to POST a JSON data using cURL - FrontBackend
Warp: Make a POST request using cURL
How to Post JSON Data Using cURL - Apidog Blog
Jun 19, 2024 · Here's how you can use cURL to make a POST request with this JSON data: curl -X POST -H "Content-Type: application/json" -d @book.json http://example.com/api/books Let me break down the command:-X POST: …
How To Use cURL to POST JSON data in HTTP POST Requests
Curl Command for POST Requests with JSON Payloads
everything-curl/http/post/json.md at master - GitHub
How to POST JSON using cURL: The Ultimate Guide
POST JSON data with CURL example - HayaGeek
How to make a POST request with curl - Linuxize
Using curl with Multiline JSON Data — Nick Janetakis
How to post JSON using Curl? - ReqBin
How to Post JSON data with cURL - STechies
How to POST JSON Data in cURL - Fedingo
How do I POST JSON data with cURL | Saturn Cloud Blog
How to POST JSON using cURL: The Ultimate Guide
http - How do I make a POST request using curl? - Super User
Curl POST JSON with examples – Guidelines - TheCodeBuzz
bash - curl with json array - Stack Overflow
Curl - POST request using JSON with query parameter
- Some results have been removed