GET and POST

Based on the configuration of the Puzzel solution, the Xml Http Client will generate a web request and send the data to the destination server using either the GET or POST method. The GET and POST methods are standards defined in RFC 2616, and represent different methods of transporting data to the server.

After the data is transported out to the server, the server can respond by sending data back. This data must always be in XML format. The returned data can be translated into other formats using Extensible Stylesheet Language Transformations, XSLT.

After processing the returned XML data, the resulting XML-formatted data is returned and processed in the Puzzel Platform for rendering in the Agent Application.

In the examples below, the caller has entered a customer number in the Agent Application and we want to retrieve the name of the customer and whether they are a GOLD, SILVER, or BRONZE customer.

Using GET

The web request may look like this when sent to the web application:

GET /echovars.php?phoneNumber=21499909&customerNumber=123456 HTTP/1.1
User-Agent: XmlHttpClient 1.0
Host: 10.47.5.10

And the web application response will look something like this (server header info has been removed):

span style="color: #4c8317;"><?xml version="1.0" ?>
<customer version="1.0">
    <status>SILVER</status>
    <name>Ola Normann</name>
</customer>

Using POST with Basic Authentication

The web request will look like this when sent to the web application:

POST /basic/echovars.php HTTP/1.1
User-Agent: XmlHttpClient 1.0
Authorization: Basic aXFhcnVzOjE=
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
Host: 10.47.5.10
phoneNumber=21499909&customerNumber=123456

And the server response will look something like this (server header info has been removed):

<?xml version="1.0" ?>
<customer version="1.0">
    <status>SILVER</status>
    <name>Ola Normann</name>
</customer>

 

Published

17/08/2020 - 15:33

Last updated

24/09/2020 - 10:40
8
2