Ajout page TipsCurl
This commit is contained in:
parent
ee0d45a60f
commit
ff25ec059d
27
TipsCurl.md
Normal file
27
TipsCurl.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
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 :
|
||||
|
||||
```
|
||||
$ curl http://192.0.2.1:8080/foo/bar -H 'Host: www.example.com'
|
||||
```
|
||||
|
||||
En HTTPs (SNI) :
|
||||
|
||||
```
|
||||
$ curl --resolve www.example.com:443:192.0.2.1 https://www.example.com/foo/bar
|
||||
```
|
||||
|
||||
## Divers
|
||||
|
||||
Afficher uniquement le header :
|
||||
|
||||
```
|
||||
$ curl -I www.example.com
|
||||
```
|
Loading…
Reference in a new issue