Update the restbuck_client, still work in progress.

Update restbuck_server, remove unused class in inherit.
Update libcurl_http_client_request, to parse context headers before the
execution.
Update wgi_input_stream, commented precondition.
This commit is contained in:
jvelilla
2011-12-09 21:11:16 -03:00
parent d961544b8b
commit c0c206e9ae
5 changed files with 33 additions and 18 deletions

View File

@@ -17,12 +17,26 @@ feature {NONE} -- Initialization
local
h: LIBCURL_HTTP_CLIENT
sess: HTTP_CLIENT_SESSION
do
create h.make
sess := h.new_session ("http://127.0.0.1:8080")
-- Create Order
create_order (sess)
-- if id /= Void and then attached sess.get ("/order/" + id, Void) as r then
-- print (r.body)
-- io.put_new_line
-- end
end
create_order (sess: HTTP_CLIENT_SESSION)
local
s: READABLE_STRING_8
j: JSON_PARSER
id: detachable STRING
context : HTTP_CLIENT_REQUEST_CONTEXT
do
create h.make
sess := h.new_session ("http://127.0.0.1")
s := "[
{
"location":"takeAway",
@@ -37,32 +51,25 @@ feature {NONE} -- Initialization
}
]"
if attached sess.post ("/order", Void, s) as r then
create context.make
context.headers.put ("application/json", "Content-Type")
if attached sess.post ("/order", context, s) as r then
print (r.raw_header)
io.put_new_line
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 id /= Void and then attached sess.get ("/order/" + id, Void) as r then
print (r.body)
io.put_new_line
end
end
feature -- Status
feature -- Access
feature -- Change
feature {NONE} -- Implementation

View File

@@ -12,8 +12,6 @@ inherit
URI_TEMPLATE_ROUTED_SERVICE
ROUTED_SERVICE_HELPER
DEFAULT_SERVICE
create