Example: web_rest

Examples of web_rest requests for HTTP methods.

Get

web_rest("get all customers info",
               "URL=http://myServer/customers?limit={limit}&offset={offset}",
               "Method=GET",
               LAST);

Put

web_rest("update customer info",
               "URL=http://myServer/customers/{cust_id}",
               "Method=PUT",
               "ResType=JSON",
               "Body={ \"address\":\"yyyy\", … }",
               LAST);

Post

web_rest("create new customer",
               "URL=http://myServer/customers/",
               "Method=POST",
               "ResType=JSON",
               "Body = { \"name\":\"john\", \"address\":\"xxxx\", … }",  /* BodyFile for large content */
               LAST);

Delete

web_rest("delete customer",
               "URL=http://www.example.com/customers/{cust_id}",
               "Method=DELETE",
               LAST);