Update restbucksCRUD example to use "crypto" library rather than "eel".
Updated readme.md to add curl command to test the server.
This commit is contained in:
@@ -155,6 +155,9 @@ Response success
|
|||||||
} ]
|
} ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
note:
|
||||||
|
curl -vv http://localhost:9090/order -H "Content-Type: application/json" -d "{\"location\":\"takeAway\",\"items\":[{\"name\":\"Late\",\"option\":\"skim\",\"size\":\"Small\",\"quantity\":1}]}" -X POST
|
||||||
|
|
||||||
|
|
||||||
How to Read an order with GET
|
How to Read an order with GET
|
||||||
-----------------------------
|
-----------------------------
|
||||||
@@ -192,7 +195,8 @@ Response
|
|||||||
} ]
|
} ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
note:
|
||||||
|
curl -vv http://localhost:9090/order/1
|
||||||
|
|
||||||
How to Update an order with PUT
|
How to Update an order with PUT
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</library>
|
</library>
|
||||||
<library name="conneg" location="..\..\library\network\protocol\content_negotiation\conneg-safe.ecf"/>
|
<library name="conneg" location="..\..\library\network\protocol\content_negotiation\conneg-safe.ecf"/>
|
||||||
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="false"/>
|
<library name="default_nino" location="..\..\library\server\wsf\default\nino-safe.ecf" readonly="false"/>
|
||||||
<library name="eel" location="$ISE_LIBRARY\contrib\library\text\encryption\eel\eel-safe.ecf" readonly="false"/>
|
<library name="crypto" location="$ISE_LIBRARY\unstable\library\text\encryption\crypto\crypto-safe.ecf" readonly="false"/>
|
||||||
<library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
|
<library name="encoder" location="..\..\library\text\encoder\encoder-safe.ecf" readonly="false"/>
|
||||||
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf" readonly="false"/>
|
<library name="http" location="..\..\library\network\protocol\http\http-safe.ecf" readonly="false"/>
|
||||||
<library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
|
<library name="json" location="..\..\contrib\library\text\parser\json\library\json-safe.ecf" readonly="false"/>
|
||||||
|
|||||||
@@ -227,8 +227,7 @@ feature -- Execution
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
ensure then
|
ensure then
|
||||||
order_saved_only_for_get_head: req.is_get_head_request_method =
|
order_saved_only_for_get_head: attached {ORDER} req.execution_variable (Order_execution_variable) implies req.is_get_head_request_method
|
||||||
attached {ORDER} req.execution_variable (Order_execution_variable)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- GET/HEAD content
|
feature -- GET/HEAD content
|
||||||
|
|||||||
@@ -6,28 +6,19 @@ note
|
|||||||
class
|
class
|
||||||
ETAG_UTILS
|
ETAG_UTILS
|
||||||
|
|
||||||
inherit
|
|
||||||
ARRAY_FACILITIES
|
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
md5_digest (a_string: STRING): STRING
|
md5_digest (a_string: STRING): STRING
|
||||||
-- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string'
|
-- Cryptographic hash function that produces a 128-bit (16-byte) hash value, based on `a_string'
|
||||||
local
|
local
|
||||||
md5: MD5
|
md5: MD5
|
||||||
output: SPECIAL [NATURAL_8]
|
|
||||||
do
|
do
|
||||||
create md5.make
|
create md5.make
|
||||||
create output.make_filled (0, 16)
|
md5.update_from_string (a_string)
|
||||||
md5.sink_string (a_string)
|
Result := md5.digest_as_string
|
||||||
md5.do_final (output, 0)
|
|
||||||
Result := as_natural_32_be (output, 0).to_hex_string
|
|
||||||
Result.append (as_natural_32_be (output, 4).to_hex_string)
|
|
||||||
Result.append (as_natural_32_be (output, 8).to_hex_string)
|
|
||||||
Result.append (as_natural_32_be (output, 12).to_hex_string)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
copyright: "2011-2012, Javier Velilla and others"
|
copyright: "2011-2014, Javier Velilla and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user