[wildfly-dev] Steamable content in management API responses

Brian Stansberry brian.stansberry at redhat.com
Thu Oct 2 18:46:03 EDT 2014


On 10/1/14, 9:52 AM, Brian Stansberry wrote:
<snip/>

>
> TODOs:
>

>
> 5) Make sure POST works well. My assumption is this is lower priority,
> as the real use cases would likely use a GET.
>

If you include the useStreamAsResponse as a query param in the URL, as 
with GET, it works. If you do the proper POST thing and encode the query 
param in the request body it doesn't. The DomainApiHandler tries to 
parse the entire request body into a ModelNode and a leading 
useStreamAsResponse& or trailing &useStreamAsResponse fails.

I'm fine with just requiring encoding the param in the URL, even though 
it isn't proper. I don't plan on spending energy near term on parsing it 
out of a POST request body.

If you're curious to try this with my resp-stream branch, this works:

curl --digest -L -D - 
http://localhost:9990/management?useStreamAsResponse --header 
"Content-Type: application/json" -u user:password -d 
'{"operation":"read-attribute","address":[{"subsystem":"logging"}],"name":"server-log","json.pretty":1}'

This doesn't:

curl --digest -L -D - http://localhost:9990/management --header 
"Content-Type: application/json" -u user:password -d 
'{"operation":"read-attribute","address":[{"subsystem":"logging"}],"name":"server-log","json.pretty":1}' 
-d useStreamAsResponse


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list