问题
So if I have prepared a REST Request, is there a way that I can view the output of it before sending for debugging purposes?
So:
LRequest.Client := LClient;
LRequest.Method := rmPOST;
LRequest.Resource := AUTH_PATH;
LRequest.Accept := 'application/json';
// required parameters
LRequest.AddParameter(ExCode, AuthCode, pkGETorPOST);
LRequest.AddParameter(ExRedirectURI, RedirectionEndPoint, pkGETorPOST);
LRequest.AddParameter(ExGrantType, ExAuthorizationCode, pkGETorPOST);
LRequest.AddParameter('Autorization', ExAuthParam, pkHTTPHEADER);
LRequest.Execute;
might yield:
POST https://oauth.platform.com/oauth2/v1/tokens/bearer HTTP/1.1
Accept: application/json
Authorization: Basic UTM0dVBvRDIwanp2OUdxNXE1dmlMemppcTlwM1d2
NzRUdDNReGkwZVNTTDhFRWwxb0g6VEh0WEJlR3dheEtZSlVNaFhzeGxma1l
XaFg3ZlFlRzFtN2szTFRwbw==
Content-Type: application/x-www-form-urlencoded
Host: oauth.platform.com
Body: grant_type=authorization_code&
code=L3114709614564VSU8JSEiPkXx1xhV8D9mv4xbv6sZJycibMUI&
redirect_uri=https://www.mydemoapp.com/oauth-redirect
来源:https://stackoverflow.com/questions/61470098/view-content-ot-trestrequest-before-sending