请问,如何把ajax语句( 用于获取jason数据 )改写为got语句? #8308
Replies: 2 comments 3 replies
-
(async () => {
const { body } = await got.post(
"http://job.hrbeu.edu.cn/HrbeuJY/Web/Employ/QueryCalendar",
{
json: {
yearMonth: "2021-09",
},
responseType: "json",
}
);
console.log(body[8]);
})(); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Derekmini
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
您好,想请教一个在路由中将
ajax
语句改写为got
的脚本写法:描述问题
请问,获取数据接口中
jason
格式数据的ajax
语句应如何改写为got
语句中?现有代码以及尝试改写的无效代码
现有的获取
jason
数据的ajax
语句尝试改写但无效的代码
现存问题
确认返回的数据不是9月份的,而是3月份的。
可以确认这个参数——
yearMonth: '2021-09'
传递不过去,我觉得是我语法写的不对。请问,在
ajax
中的**data——规定要发送到服务器的数据。**这一项改写到got中应该是什么样的?来此处求助,希望能得到您一些提示,谢谢您的帮助!
源文件
对应的文件为:
Scripts/calendar.js?v=0.1
代码如下:
calendar.js
文件内容如下:Beta Was this translation helpful? Give feedback.
All reactions