beautypg.com

Overview, Http post, Post reply – AML KDT750 Price Verification System User Manual

Page 20: Kdt750 apl guide

background image

KDT750 APL Guide

3 - 2

Overview

HTTP (Hypertext Transfer Protocol) is the most common of all Internet protocols. Although it is
used primarily to fetch pages from web servers to display in a browser, it is actually a
general purpose transmission protocol. Since many large scale networks do not support
opening new TCP sockets but already host web based portals, APL has been designed to
use the HTTP POST method of sending and receiving data to and from a server.

HTTP POST

HTML forms already define a VALUE=ITEM style interface that works well when integrated
with APL. Following the APL guidelines, the client application will create POST data with the
appropriate request event name (BAR, INP, etc...) as a field name and the data value being
the supplied data.

For example, if an internal bar code reader was used to scan a bar code containing the
data “1234567890”, APL would post data to the server in the form of an input field named
“BAR” with a value of “1234567890”. If this data was actually coming from an HTML form, it
would have been formatted as such in HTML:

< input name="BAR" type="text" value='1234567890' />

POST Reply

The server side application or script should preform the desired action on the data and
supply a meaningful response to the user. ITEM=VALUE pairs in the reply should be sent as
plain text in the normal “ITEM=VALUE” format.

More often than not, this reply will contain multiple action or text output pairs.

When using HTTP POST, APL defines the separation between ITEM=VALUE pairs by a carriage
return or new line.

It is also important that the reply contains a valid HTTP header.

Example server reply:

Content-type: text/html

PARTNUM=P/N: 123789

@PARTNUM=200,200,240,35,35,50