Coopr 526 -Implementation of the Plugins REST Client API Interface

it would be better to use the netty-http library for this test server.  All these if conditions make it hard to understand what is happening and will make this class hard to maintain.