Question

How to Log Raw REST Request

How do you log the Raw Request that Pega is sending for a Connect-REST POST:

Not just the JSON and not the other bits and pieces that the debug logging gives you and not the other bits and pieces available on the parameter page in the tracer, but the actual full Raw request.

That would look like follows:
POST http://<myurl>/alfresco/api/-default-/public/alfresco/versions/1/nodes/<>/children HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_5_403844976.1545345515359"
MIME-Version: 1.0
Authorization: Basic 23434545454234545
Content-Length: 446
Host: 10.2.2.96:8082
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

------=_Part_5_403844976.1545345515359
Content-Type: multipart/form-data
Content-Transfer-Encoding: 8bit

{
"name":"TestFile.txt",
"nodeType":"cm:content"
}

------=_Part_5_403844976.1545345515359
Content-Type: text/plain; charset=Cp1252; name=HelloWorld.txt
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="HelloWorld.txt"; filename="HelloWorld.txt"

Hellow World!
------=_Part_5_403844976.1545345515359--

***Edited by Moderator: Pallavi to update platform capability tags***

Correct Answer
December 31, 2018 - 1:57pm

Enbaling the "Debug/All" for "com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector" class will log the content of request and response. 

When viewing the log files, if viewing through Pega Designer Study, then you need to remove your username from the filter options in order to see the raw request content in the log

 

Comments

Keep up to date on this post and subscribe to comments

December 31, 2018 - 1:57pm

Enbaling the "Debug/All" for "com.pega.pegarules.integration.engine.internal.connect.rest.RESTConnector" class will log the content of request and response. 

When viewing the log files, if viewing through Pega Designer Study, then you need to remove your username from the filter options in order to see the raw request content in the log