www.uniface.com lectu res. lectu res.
www.uniface.coml ectures.
AgendaPre-requisite:You must have a OneDrive account.(Not OneDrive for Business)
What we will coverIntroduction to REST
Uniface Web Capabilities
Using REST-ful Services
www.uniface.coml ectures.
RESTRepresentational State Transfer
Roy Fielding used the term in his doctorate
Design principles for HTTP
REST-ful ServicesUse standard HTTP methods Move away from the complexity of SOAP
www.uniface.coml ectures.
Uniface CapabilitiesUniface HTTP Clients
HTML WidgetFor interactive use
UHTTP ComponentUsed in PROC
Uniface HTTP ServersUSP, Static Server PageDSP, Dynamic Server Page
www.uniface.coml ectures.
What is an HTTP Request?A network message sent to a URL, consisting in its simplest form, of:-Header lineHeader line…
Body lineBody line….
www.uniface.coml ectures.
UHTTP ComponentUHTTP Component uses this simple form of HTTP request. There is no support for Multi-Part requests.
Some API’s offer the capability to get meta-data and a file.
The UHTTP Component must use two separate requests.
www.uniface.coml ectures.
UHTTP Component
Send a request and receive a response.
Send(URL, Method, user, pass, Headers, Contents, Status Line)
Send a file and receive a response.
Load_File_Contents(Filename, OptionList)
Send(URL, Method, user, pass, Headers, Contents, Status Line)
www.uniface.coml ectures.
UHTTP Component
Send(URL, Method, user, pass, Headers, Contents, Status Line)
Send a request and receive a response. The Contents field is a ‘string’ INOUT parameter. The developer provides the Contents which is sent as the body of the HTTP request. The response body is placed back into Contents.
www.uniface.coml ectures.
UHTTP Component
Load_File_Contents(Filename, OptionList)
Send(URL, Method, user, pass, Headers, Contents, Status Line)
Send a file and receive a response. The contents of the file will be loaded into the HTTP request body and sent. The Contents field is not used for input. The response body will be returned in the Contents field.
www.uniface.coml ectures.
UHTTP ComponentDump_File_Contents(Filename, OptionList)
Send(URL, Method, user, pass, Headers, Contents, Status Line)
Dump_File_Contents(Filename, OptionList)
Declare the HTTP response body to be a file. The Contents field is not used. Send the request for the file to the API. Dump the HTTP response body into a file.
www.uniface.coml ectures.
UHTTP ComponentGet_Info(Option, String_Information)
Get information about a file transfer. The file is transferred directly to and from the file system. The developer does not have access to it during the transfer. The transfer of the file may require information like a file size, a digest or a range header. This operation aids in creating for such items.
www.uniface.coml ectures.
Follow us online
uniface.comunifaceinfo.com/forum