ajout HTTP/1.1 100 Continue
This commit is contained in:
parent
3f572aef05
commit
ef308b0788
45
HowtoHTTP.md
45
HowtoHTTP.md
|
@ -68,6 +68,51 @@ Content-Language: en
|
|||
Connection closed by foreign host.
|
||||
~~~
|
||||
|
||||
#### HTTP/1.1 100 Continue
|
||||
|
||||
Avec le protocole HTTP/1.1, il y a une utilisation spécifique pour pour l'envoi « décalé » d'un gros payload.
|
||||
|
||||
Par exemple un client va envoyer un :
|
||||
|
||||
~~~
|
||||
POST /callback
|
||||
Content-Type: application/pdf
|
||||
Content-Length: 123456
|
||||
Expect: 100-continue
|
||||
~~~
|
||||
|
||||
Le serveur va alors lui répondre `HTTP/1.1 100 Continue` et ensuite seulement le client enverra le contenu du PDF puis le serveur enverra la réponse finale `HTTP/1.1 200 OK`.
|
||||
|
||||
Plus d'infos sur :
|
||||
|
||||
* <https://http.dev/100>
|
||||
* <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100>
|
||||
|
||||
|
||||
Voici une commande `curl` pour reproduire cela :
|
||||
|
||||
~~~
|
||||
$ curl --http1.1 -v -H "Expect: 100-continue" -F person=anonymous -F secret=@/tmp/foo.bin https://www.example.com/callback
|
||||
* Connected to ...
|
||||
> POST /callback HTTP/1.1
|
||||
> Host: www.example.com
|
||||
> Accept: */*
|
||||
> Expect: 100-continue
|
||||
> Content-Length: 309
|
||||
> Content-Type: multipart/form-data; boundary=------------------------d5c85d941a76e4fa
|
||||
>
|
||||
* TLSv1.3 (IN) ...
|
||||
< HTTP/1.1 100 Continue
|
||||
* We are completely uploaded and fine
|
||||
* Mark bundle as not supporting multiuse
|
||||
< HTTP/1.1 200 OK
|
||||
< content-type: text/html; charset=UTF-8
|
||||
< transfer-encoding: chunked
|
||||
<
|
||||
Hello World
|
||||
* Connection #0 to host ...
|
||||
~~~
|
||||
|
||||
### HTTPS
|
||||
|
||||
On gère le tunnel SSL avec `openssl` puis tout est en clair :
|
||||
|
|
Loading…
Reference in a new issue