Host integration - REST HTTP

  1. Introduction
  2. Examples of HTTP verbs and paths
  3. Example of POSXML application

Introduction

There is a way to integrate CloudWalk POSXML applications with REST APIs. It can be done by using the command network.send with a string in the following format:

POST / buf=0123456789&anotherVariable=ABCDEF

The CloudWalk Switch will receive the request sent through the command network.send and will perform the HTTP request on the url defined on the application configured on https://manager.cloudwalk.io.

To receive the answer from CloudWalk Switch, it is necessary to use the command network.receive to receive the first 4 bytes that indicates the size of the message, and then receive the rest of the message with a second network.receive call. This approach avoid timeouts and long wait times to receive the response from your HTTP endpoint.

Examples of HTTP verbs and paths

HTTP-VERB PATH VARIABLES
POST / buf=0123456789&anotherVariable=ABCDEF
POST /index.php foo=1&bar=2
GET /list.asp id=123
GET /
DELETE /products/28

Example of POSXML application

The following example can be used to test this kind of HTTP integration: