HTTP.getPayload  ( addr maxn -- )

publication: 4 août 2022 / mis à jour 4 août 2022

Read this page in english

 

Récupère le contenu de la transaction demandée par HTTP.doGet et le transfère dans un tampon.

HTTP.getPayload est précédé de l'adresse du tampon de réception et le nombre maximal d'octets attendus. Après réception, ce tampon contient une chaîne terminée par 0.

Exemple:

HTTP 
create httpBuffer 
    700 allot 
: run ( -- ) 
    cr 
    z" http://ws.arduino-forth.com/" HTTP.begin  
    if 
        HTTP.doGet dup ." Get results: " . cr 0 > 
        if  
            httpBuffer 700 HTTP.getPayload 
            httpBuffer z>s dup . cr type 
        then 
    then 
    HTTP.end 
  ; 

Lien vers article:

/article/http_implementation


Legal: site web personnel sans commerce / personal site without seling