Ajout d'infos sur ab
This commit is contained in:
parent
5a260f8b25
commit
137623feee
44
HowtoHTTP.md
44
HowtoHTTP.md
|
@ -1,10 +1,12 @@
|
|||
# Howto HTTP
|
||||
|
||||
## telnet
|
||||
Le procotole HTTP (HyperText Transfer Protocol) est un protocole client/serveur de niveau 7 s'appuyant par convention sur la couche de transport TCP et le port 80. Sa version sécurisée est HTTPS qui s'appuye en plus sur la couche [SSL/TLS](HowtoSSL).
|
||||
|
||||
## Comprendre les différentes versions de HTTP grâce à telnet
|
||||
|
||||
### HTTP/1.0
|
||||
|
||||
Le plus simple, entête `Host:` facultatif :
|
||||
La version la plus simple, ll'entête `Host:` est facultatif :
|
||||
|
||||
~~~
|
||||
$ telnet www.debian.org 80
|
||||
|
@ -33,7 +35,7 @@ Connection closed by foreign host.
|
|||
|
||||
### HTTP/1.1
|
||||
|
||||
Entête `Host:` obligatoire :
|
||||
L'entête `Host:` est obligatoire :
|
||||
|
||||
~~~
|
||||
$ telnet www.debian.org 80
|
||||
|
@ -99,6 +101,38 @@ Server: Apache
|
|||
[...]
|
||||
~~~
|
||||
|
||||
## cURL
|
||||
### HTTP/2.0
|
||||
|
||||
Voir [TipsCurl]()
|
||||
<https://fr.wikipedia.org/wiki/Hypertext_Transfer_Protocol/2>
|
||||
|
||||
|
||||
## Outils
|
||||
|
||||
### HEAD/GET/POST
|
||||
|
||||
~~~
|
||||
# apt install libwww-perl
|
||||
~~~~
|
||||
|
||||
Voir <http://gcolpart.evolix.net/blog21/faire-du-postgethead-en-ligne-de-commande/>
|
||||
|
||||
### cURL
|
||||
|
||||
Voir [TipsCurl]()
|
||||
|
||||
### ab : apache bench
|
||||
|
||||
~~~
|
||||
# apt install apache2-utils
|
||||
~~~
|
||||
|
||||
|
||||
Utilisation :
|
||||
|
||||
~~~{.bash}
|
||||
$ ab -n 1000 -c 100 -l http://127.0.0.1/helloworld.txt
|
||||
~~~
|
||||
|
||||
* `-n` : nombre de requêtes
|
||||
* `-c` : nombre de requêtes effectuées en simultané
|
||||
* `-l` : option importante qui tolère la variation de la réponse du serveur (si non, les requêtes seront notées en *Failed requests*)
|
||||
|
|
Loading…
Reference in New Issue