有没有办法打印 Twilio-API 在发送短信时发出的 POST 请求 URL?

Is there a way to print the POST request URL that the Twilio-API makes when sending SMS?

我需要 Twilio 在发送 SMS 时发出的确切请求 URL。有没有办法print/log呢?当我使用 Message.getUri 方法时,它给了我一些以 .json 结尾的东西,我认为这是 Twilio 在发出请求后的响应。根据我的阅读,它应该类似于“https://api.twilio.com/2010-04-01/Accounts//Messages”.

我正在使用 Java API:

com.twilio.rest.api.v2010.account.Message
    .creator(new PhoneNumber(toNumber), // to
        new PhoneNumber(twilioFromNumber), // from
        textMessage)
    .create();

URL确实是

https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json

其中 ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 是帐户 SID,如果您在 https://www.twilio.com/console

登录您的 Twilio 帐户控制台,您可以在仪表板上找到它

在 (https://www.twilio.com/docs/sms/send-messages?code-sample=code-send-an-sms-message&code-language=curl&code-sdk-version=json#linkcode)

查看更多文档