Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ljzms1212 opened this issue Dec 29, 2023 · 0 comments
Open

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

ljzms1212 opened this issue Dec 29, 2023 · 0 comments

Comments

@ljzms1212
Copy link

ljzms1212 commented Dec 29, 2023

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

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

@ljzms1212 ljzms1212 changed the title url中有中文时,无法请求接口 Url 路径参数中有中文时,无法请求接口 Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant