We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
请求: $.ajax({ url: "https://bird.ioliu.cn/v2/?url=https://dataapi.joinquant.com/apis", type: 'POST', data: JSON.stringify({ "method": "get_concepts", "token": "5b6a9ba1b2f072b726667f2f", "code": "sw_l1", }), }
响应: error: invalid character '%' looking for beginning of value
The text was updated successfully, but these errors were encountered:
@xCss 此问题我fork了一个版本 已经解决了 方便的话 请核查下
问题原因: 所有POST数据 被统一设置到requst的参数form中,而对于JSON数据未区分判断设置到 request的参数body中
问题代码:
JsonBird/utils/utils.js
Line 74 in 46cbb69
修正代码 :
if (method === 'POST') { if (headers['content-type'].includes('application/x-www-form-urlencoded')) { config['form'] = params; } else if (headers['content-type'].includes('application/json')) { config['body'] = JSON.stringify(params); } else { config['body'] = params; } } else { config['url'] = config['url'] ? `${config['url']}?${qs.stringify(params)}` : (url?`${url}?${qs.stringify(params)}`:null) ; }
Sorry, something went wrong.
No branches or pull requests
请求:
$.ajax({
url: "https://bird.ioliu.cn/v2/?url=https://dataapi.joinquant.com/apis",
type: 'POST',
data: JSON.stringify({
"method": "get_concepts",
"token": "5b6a9ba1b2f072b726667f2f",
"code": "sw_l1",
}),
}
响应:
error: invalid character '%' looking for beginning of value
The text was updated successfully, but these errors were encountered: