Skip to content

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

@ljzms1212

Description

@ljzms1212

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

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions