eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTTPSimpleJSONRestClient':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HTTPSimpleJSONRestClient


Inheritance:

   Object
   |
   +--HTTPSimpleJSONRestClient

Package:
stx:goodies/communication
Category:
Net-Communication-Rest
Version:
rev: 1.5 date: 2019/05/29 21:58:54
user: cg
file: HTTPSimpleJSONRestClient.st directory: goodies/communication
module: stx stc-classLibrary: communication
Author:
cg

Description:


Abstract superclass for JSON based Rest service clients.
This passes arguments as JSON post-data.
Callable methods can be automatically detected via the protocolInfo rest call,
if the partner is an ST/X based rest service.
See concrete subclasses on how the call interface works.

[start Server with:]
    HTTPServer startServerOnPort:9876

[start a Demo Service with:]
    (HTTPSimpleJSONRestDemoService new)
        linkName:'/rest';
        registerServiceOn:(HTTPServer serverOnPort:9876)

[request:]
    |client|

    client := self newForURL:'localHost:9876/rest'.
    (client call:'protocolInfo') inspect.
    (client call:'string') inspect.


[instance variables:]

[class variables:]


Related information:



Class protocol:

instance creation
o  newForURL: baseUrlArg


Instance protocol:

accessing
o  baseUrl

o  baseUrl: something

calling
o  call: name

o  call: name with: argument
argument is usually a dictionary with key-value assocs



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Wed, 17 Aug 2022 22:39:54 GMT