1. What is CURL
2. How to run curl on Windows
3. Hot to run api request with curl : GET, POST, PUT, DELETE
https://curl.haxx.se
use Curl to get public IP address
curl ipinfo.io/ip
curl ifconfig.me
https://www.youtube.com/watch?v=8f9DfgRGOBo
C:\Users\dkhemr01>curl http://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
C:\Users\dkhemr01>curl -L http://google.com
TO GET HEADER
C:\Users\dkhemr01>curl -i http://google.com
C:\Users\dkhemr01>curl -i http://google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Thu, 07 May 2020 00:51:16 GMT
Expires: Sat, 06 Jun 2020 00:51:16 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
C:\Users\dkhemr01>
C:\Users\dkhemr01>curl --head http://google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Thu, 07 May 2020 00:52:35 GMT
Expires: Sat, 06 Jun 2020 00:52:35 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
C:\Users\dkhemr01>
C:\Users\dkhemr01>curl -verbose http://google.com
* Rebuilt URL to: http://google.com/
* Trying 172.217.10.78...
* TCP_NODELAY set
* Connected to google.com (172.217.10.78) port 80 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.55.1
> Accept: */*
> Referer: rbose
>
< HTTP/1.1 301 Moved Permanently
< Location: http://www.google.com/
< Content-Type: text/html; charset=UTF-8
< Date: Thu, 07 May 2020 00:53:20 GMT
< Expires: Sat, 06 Jun 2020 00:53:20 GMT
< Cache-Control: public, max-age=2592000
< Server: gws
< Content-Length: 219
< X-XSS-Protection: 0
< X-Frame-Options: SAMEORIGIN
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
* Connection #0 to host google.com left intact
C:\Users\dkhemr01>
curl --insecure -v https://bcbsmastage.medhokapps.com/medhokws/ws/
* About to connect() to bcbsmastage.medhokapps.com port 443 (#0)
* Trying 10.100.2.219...
^C
No comments:
Post a Comment