command line tool and library for transferring data with URLs.
What's curl used for?
curl is used in command lines tool or scripts to transfer data.
URL based data transfer
Simple usage for all HTTP verbs
Used in applications that affect billions of users daily.
HTTP Methods With curl
Every HTTP request contains a method. The most commonly used methods are GET, POST, PUT and DELETE.
GET
curl -v https://www.w3schools.com/angular/customers.php
output
output
C:\curl\bin>curl -g https://www.w3schools.com/angular/customers.php { "records":[ {"Name":"Alfreds Futterkiste","City":"Berlin","Country":"Germany"}, {"Name":"Ana Trujillo Emparedados y helados","City":"México D.F.","Country":"Mexico"}, {"Name":"Antonio Moreno Taquería","City":"México D.F.","Country":"Mexico"}, {"Name":"Around the Horn","City":"London","Country":"UK"}, {"Name":"B's Beverages","City":"London","Country":"UK"}, {"Name":"Berglunds snabbköp","City":"Luleå","Country":"Sweden"}, {"Name":"Blauer See Delikatessen","City":"Mannheim","Country":"Germany"}, {"Name":"Blondel père et fils","City":"Strasbourg","Country":"France"}, {"Name":"Bólido Comidas preparadas","City":"Madrid","Country":"Spain"}, {"Name":"Bon app'","City":"Marseille","Country":"France"}, {"Name":"Bottom-Dollar Marketse","City":"Tsawassen","Country":"Canada"}, {"Name":"Cactus Comidas para llevar","City":"Buenos Aires","Country":"Argentina"}, {"Name":"Centro comercial Moctezuma","City":"México D.F.","Country":"Mexico"}, {"Name":"Chop-suey Chinese","City":"Bern","Country":"Switzerland"}, {"Name":"Comércio Mineiro","City":"São Paulo","Country":"Brazil"} ] } C:\curl\bin>
Format JSON!
curl -g https://www.w3schools.com/angular/customers.php | json
- Download and install NodeJS from its official homepage https://nodejs.org/en/.
- cmd> npm install -g jsontool
Reference
- curl: https://curl.se/
- curl windows Download: https://curl.se/windows/
- curl Example https://reqbin.com/req/c-dwjszac0/curl-post-json-example/
No comments:
Post a Comment