שימוש בלולאת for-range כדי לשלוח בקשות HTTP

משתמש באיטרציה מבוססת-טווח כדי לשלוח בקשות HTTP.

המשך למידה

לקבלת הסבר מפורט שכולל את דוגמת הקוד הזו, קראו את המאמר:

דוגמת קוד

YAML

- init:
    assign:
      - minTemp: -14.5
      - maxTemp: 42.8
- storeNormalBodyTemp:
    for:
      value: temp
      range: ${[minTemp, maxTemp]}
      steps:
        - checkTemp:
            call: http.get
            args:
              url: ${"https://example.com/isBodyTempNormal?temp=" + string(temp)}
            result: isNormal
        - storeOrBreak:
            switch:
              - condition: ${isNormal}
                next: storeTemp
            next: break
        - storeTemp:
            call: http.post
            args:
              url: ${"https://example.com/storeTemp?temp=" + string(temp)}
              body: ${temp}

המאמרים הבאים

כדי לחפש ולסנן דוגמאות קוד למוצרים אחרים של Google Cloud , אפשר להיעזר בGoogle Cloud דפדפן לדוגמה.