Skip to content

HTTP表单方式提交

ben.zhuang edited this page Oct 14, 2022 · 1 revision

大部分 NXcloud 的接口都是以这种方式提交的。

  • 需要设置 HTTP METHOD 为 POST
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    connection.setRequestMethod("POST");
  • 需要添加 Content-Type: application/x-www-form-urlencoded
    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
  • 请注意对提交的字段做正确的 urlencode
    String body = "phone=8411111111&content=" + URLEncoder.encode("您的 短信内容 ,您的 短链内容", "UTF-8") + "&.....";

一个使用 postman 提交的示例截图

使用postman截图

Introduction

WhatsApp

Short message

Voice

Call Center(NXLink)

AI Agent(NXLink)

Call Center(Callbot)

Flash Call

Short links

邮件验证码

DID号码

通用

号码检测

Clone this wiki locally