RestServices - Body from form-data POST action

0
I'm testing a microflow where I submit a file using the POST java function as form-data. For debug purposes i would like to see what form-data is send in the request, but the RestConsume logging only shows the request without the data. Is there a way to get this data in the logging?
asked
2 answers
1
Hi Kevin,

I had the same issue and found that you can set the log level for any outgoing calls via restCustomized with some java code.


System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");

Source: http://hc.apache.org/httpclient-3.x/logging.html

For best results I just ran the project from Eclipse.

Hope this helps,
Andrej

 

answered
0

Hi Kevin,

  I do not know of a default log node that will include the JSON data if you POST as form, but what may be helpful to you is to create your own logging, using the 'log' microflow action, and include the JSON you are about to send.  There is a helpful Java action called 'SerializeObjectToJSON' in the REST appstore module that you can use to build your JSON independant of the POST action and then include that in a log node that you create.  This will at least give you visibility into the JSON content you have sent.

  Hope this helps,

Rob

answered