aliyun / api-gateway-nodejs-sdk

The API Gateway SDK for Node.js
MIT License
106 stars 23 forks source link

Url 路径参数中有中文时,无法请求接口 #37

Open ljzms1212 opened 8 months ago

ljzms1212 commented 8 months ago

带有路径参数的路由,如果参数是中文,则无法请求接口,例如:

async function get() {
  var url = 'https://www.test.com/user-info/张三/xxxxx';
  const option = {
    dataType: 'json',
    timeout: 120000,
    headers: {
      accept: 'application/json;charset=UTF-8'
    }
  };

  // var result = await client.get(encodeURI(url),option);
  var result = await client.get(url, option);
  console.log(JSON.stringify(result));
}

get();