0
0
IOT Protocolsdevops~10 mins

Why HTTP serves request-response IoT needs in IOT Protocols - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show the HTTP method used for request-response communication.

IOT Protocols
http_method = "[1]"
Drag options to blanks, or click blank then click option'
AGET
BPOST
CCONNECT
DTRACE
Attempts:
3 left
💡 Hint
Common Mistakes
Using POST instead of GET for simple data retrieval.
2fill in blank
medium

Complete the code to define the HTTP status code for a successful response.

IOT Protocols
status_code = [1]
Drag options to blanks, or click blank then click option'
A200
B301
C500
D404
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 404 (not found) with 200 (success).
3fill in blank
hard

Fix the error in the HTTP request line to correctly specify the method.

IOT Protocols
request_line = "[1] /sensor/data HTTP/1.1"
Drag options to blanks, or click blank then click option'
AFETCH
BGET
CSEND
DPULL
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-standard methods like FETCH or SEND.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps sensor IDs to their status if status is 'active'.

IOT Protocols
active_sensors = {sensor_id: [1] for sensor_id, [2] in sensors.items() if status == 'active'}
Drag options to blanks, or click blank then click option'
Astatus
Cvalue
Dstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names like value or state.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps sensor IDs to their readings if reading is above 50.

IOT Protocols
filtered_readings = [1]([2]: [3] for [2], reading in readings.items() if reading > 50)
Drag options to blanks, or click blank then click option'
Adict
Bsensor_id
Creading
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of dict, or wrong variable names.