Does Snap support RESTful API features?

Well, we can use "URL & split" to get/parse https/http responses. Does any block can be used to handle RESTful APIs?

File -> Libraries... -> Web services access (https) -> Import

Thanks.

What the heck is a restful?

Sending requests to servers to get information
[EDIT: "no utube"]

no utube

RESTful = REST. More info: What is a REST API?

How to post a json list to Restful server with snap? quite confused.

json of list (same block as length of list)
I think you put the json in the send (internally called payload) parameter.

Well, restful server prints: "I (8813) http: Light control: a List [3 elements]", actually "a List [3 elements]", so it seems NOT a json string. Any way to convert list to json object?

List in Snap seems OK, kind of a table.
图片

Should be something like bellow string format:

It seems OK with

Really weird , why set channel5 to 1500 is a string???? not int?

Is there any way to convert it to int?


A way to convert a string to number is by using any math block in place of the value. I personally would not do it in snap, but instead have the server convert the string to a number. That way you don't have to rely on snap sending the correct data type.

Yeah, HTTP server has added type check. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.