2016-10-06 11:04:37 +02:00
|
|
|
---
|
|
|
|
categories: tips
|
|
|
|
title: Tips cURL
|
|
|
|
...
|
|
|
|
|
|
|
|
## Outrepasser le nom de domaine
|
|
|
|
Avec cette astuce, pas besoin de modifier `/etc/hosts`, ce qui est très pratique.
|
|
|
|
|
|
|
|
En HTTP classique :
|
|
|
|
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|
2016-10-06 11:04:37 +02:00
|
|
|
$ curl http://192.0.2.1:8080/foo/bar -H 'Host: www.example.com'
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|
2016-10-06 11:04:37 +02:00
|
|
|
|
|
|
|
En HTTPs (SNI) :
|
|
|
|
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|
2016-10-06 11:04:37 +02:00
|
|
|
$ curl --resolve www.example.com:443:192.0.2.1 https://www.example.com/foo/bar
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|
2016-10-06 11:04:37 +02:00
|
|
|
|
|
|
|
## Divers
|
|
|
|
|
|
|
|
Afficher uniquement le header :
|
|
|
|
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|
2016-10-06 11:04:37 +02:00
|
|
|
$ curl -I www.example.com
|
2017-01-20 10:51:37 +01:00
|
|
|
~~~
|