22
0
Fork 0

Ajout page TipsCurl

This commit is contained in:
Benoît S. 2016-10-06 11:04:37 +02:00
parent ee0d45a60f
commit ff25ec059d
1 changed files with 27 additions and 0 deletions

27
TipsCurl.md Normal file
View 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
```