# FAQ

# Request Header中的Authorization值如何填写?

  1. 登录商户后台
  2. 在APP管理中找到需要接入的APP,点击进入详情
  3. 找到APP ID和Secret Key
  4. 使用':'连接APP ID和Secret Key,得到待加密字符串str
  5. 对待加密字符串str使用Base64加密得到加密后字符串strEncoded
  6. 使用'Basic '连接strEncoded,得到结果authStr
  7. 将authStr放入Request Header的Authorization值内
  APP ID : '1234567890'
  Security Key : 'abcdefg'

  str = '1234567890:abcdefg'
  strEncoded = Base64(str)
  // strEncoded结果为'MTIzNDU2Nzg5MDphYmNkZWZn'
  authStr = 'Basic MTIzNDU2Nzg5MDphYmNkZWZn'
  // Java
  import org.springframework.util.Base64Utils
  
  String appId = "1234567890";
  String securityKey = "abcdefg";
  String authStr = "Basic " + Base64Utils.encodeToString((appId + ":" + securityKey).getBytes());
  authStr = 'Basic MTIzNDU2Nzg5MDphYmNkZWZn';

  // POST
  Method: POST
  Header:Content-Type: application/json
  Header:Authorization: 'Basic MTIzNDU2Nzg5MDphYmNkZWZn'