View content ot TRESTRequest before sending?

余生颓废 提交于 2021-02-11 12:32:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!