Search code examples
lwuitcodenameone

How to add arguments without key, to add only value to the body of ConnectionRequest


I want to add a Json object to ConnectionRequest as value without key. I know that if use standard addArgument(key,value) -

addArgument("json","{JsonObject}")

in the body of request will be

json={JsonObject}

But I need to add only JsonObject without key and "=" symbol.

{JsonObject}

Is there any standard solution? One more question Is there any class in Lwuit to create JsonObject similar to json.org.me Thanks


Solution

  • Sure, just override

    protected void buildRequestBody(OutputStream os)
    

    And write whatever you want into the output stream. Don't use the arguments this will replace them anyway.