Added "Date:" helper feature in EWF_HEADER
Added license.lic to restbuck example, and mainly copyright to Javier Use HTTP_STATUS_CODES Minor improvements using object tests Cosmetic (indentation, ..)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
|
||||
<library name="http_client" location="..\..\..\library\client\http_client\http_client-safe.ecf" readonly="false"/>
|
||||
<library name="json" location="..\..\..\ext\text\json\library\json-safe.ecf" readonly="false"/>
|
||||
<library name="thread" location="$ISE_LIBRARY\library\thread\thread-safe.ecf"/>
|
||||
<cluster name="src" location=".\src\" recursive="true"/>
|
||||
</target>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
</option>
|
||||
<setting name="concurrency" value="thread"/>
|
||||
<library name="http_client" location="..\..\..\library\client\http_client\http_client.ecf"/>
|
||||
<library name="json" location="..\..\..\ext\text\json\library\json.ecf" readonly="false"/>
|
||||
<library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/>
|
||||
<library name="thread" location="$ISE_LIBRARY/library/thread/thread.ecf"/>
|
||||
<cluster name="src" location="./src" recursive="true"/>
|
||||
|
||||
@@ -18,6 +18,8 @@ feature {NONE} -- Initialization
|
||||
h: LIBCURL_HTTP_CLIENT
|
||||
sess: HTTP_CLIENT_SESSION
|
||||
s: READABLE_STRING_8
|
||||
j: JSON_PARSER
|
||||
id: detachable STRING
|
||||
do
|
||||
create h.make
|
||||
sess := h.new_session ("http://127.0.0.1")
|
||||
@@ -36,11 +38,23 @@ feature {NONE} -- Initialization
|
||||
]"
|
||||
|
||||
if attached sess.post ("/order", Void, s) as r then
|
||||
print (r.body)
|
||||
if attached r.body as m then
|
||||
create j.make_parser (m)
|
||||
|
||||
if j.is_parsed and attached j.parse_object as j_o then
|
||||
if attached {JSON_STRING} j_o.item ("id") as l_id then
|
||||
id := l_id.item
|
||||
end
|
||||
print (m)
|
||||
io.put_new_line
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if attached sess.get ("/order/1", Void) as r then
|
||||
if id /= Void and then attached sess.get ("/order/" + id, Void) as r then
|
||||
print (r.body)
|
||||
io.put_new_line
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user