Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript GET和POST的奇怪行为_Javascript_Html_Rest_Post_Get - Fatal编程技术网

Javascript GET和POST的奇怪行为

Javascript GET和POST的奇怪行为,javascript,html,rest,post,get,Javascript,Html,Rest,Post,Get,我正在尝试使用iOS中的web服务来复制此表单的功能。不过我遇到了一个问题。每当我发帖子给它,我都会收到一个错误 <html><head> <title>410 Gone</title> </head><body> <h1>Gone</h1> /prod/bwckschd.p_get_crse_unsechas been permanently removed from this server.<

我正在尝试使用iOS中的web服务来复制此表单的功能。不过我遇到了一个问题。每当我发帖子给它,我都会收到一个错误

<html><head>
<title>410 Gone</title>
</head><body>
<h1>Gone</h1>
/prod/bwckschd.p_get_crse_unsechas been permanently removed from this server.</p>
</body></html>

410不见了
跑了
/prod/bwckshd.p_get_crse_unsechas已从此服务器中永久删除

当我转到并选择2013年春季时,它会带我去。问题是,只有通过第1页才能到达第2页。网站如何知道你是否通过了那里?我四处寻找,发现它发送了一个POST请求,值为p_calling_proc=bwckshd.p_disp_dyn_sched和p_term=201320(2013年春季)。当我发送page2这个POST命令时,我得到的结果就像我只是访问了第2页而没有访问第1页一样:“/prod/bwckgens.p_proc_term_date已从此服务器上永久删除。”然后我想我应该表现得更像一个web浏览器,最初向第1页发送get请求。当我收到回复时,我应该发送一个POST请求,并填写上述数据。当我这样做的时候,我仍然会得到同样的错误。有什么我没有考虑的吗?我想做的就是发送GET/POST请求,这样我就可以得到所提供的类的列表

第二个页面基本上使用以下变量向发送POST请求: 术语=201320&sel\U SUBSC=CS&sel\U day=虚拟和sel\U schd=虚拟和sel\U insm=虚拟和sel\U camp=虚拟和sel\U levl=虚拟和sel\U sess=虚拟和sel\U仪表=虚拟和sel\U ptrm=虚拟和sel\U attr=虚拟


有人能帮我找出如何复制这种行为吗?我对网络开发知之甚少,感觉我错过了一个关键点,这阻碍了我完成这个应用程序。谢谢。

很可能第一页设置了第二页检查的cookie。

cookie不是HTML的一部分。它是HTTP头的一部分。如果您查看响应头(例如,在firebug中,或使用
curl-v'https://selfservice.mypurdue.purdue.edu/prod/bwckschd.p_disp_dyn_sched?“
)对于第一页,您可以看到正在设置cookie。如果不访问服务器端代码,就不可能知道服务器对该cookie做了什么,但这是cookie的典型用法。