HTTP POST请求导致“错误405:方法不允许”

时间:2013-10-03 19:32:37

标签: http post wget

我正在尝试在以下网站上进行简单的HTTP POST:

https://oktap.tax.ok.gov/oktap/web/_/

(点击左下角的“Permits”)

我只是想张贴一个号码并从返回的页面中获取结果。使用chrome的Web开发人员工具查看该页面,看起来POST同时适用于

https://oktap.tax.ok.gov/oktap/web/_/Recalc
https://oktap.tax.ok.gov/oktap/web/_/EventOccurred

我不确定它是否是其中之一,看起来EventOccured需要更多参数。但是,当我使用以下代码发布其中任何一个时:

#!/usr/bin/env bash

wget --post-data="D0IHwpHb__0_0_Ful0QW=5&VIEW__=VS_PermitSearch&LASTFOCUSFIELD__=D0IHwpHb__0_0_Ful0QW&DOC_MODAL_ID__=0&EVENT__=D0IHwpHb__0_0_Ful0QW&DOC_ACTION__=false&TYPE__=1&CLOSECONFIRMED__=false&FAST_VERLAST__=9.CvUZWPROHiWR-EO6d9UAeHYv4m81" \
-U "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547 Safari/537.36" \
https://oktap.tax.ok.gov/oktap/web/_/EventOccurred

首先我获得307临时重定向,然后获得ERROR 405:方法不允许。

我看不到帖子是如何被禁止的,当它显然是从浏览器制作时就好了。任何帮助?

这是标题:

Request URL:https://oktap.tax.ok.gov/oktap/web/_/Recalc
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:146
Content-Type:application/x-www-form-urlencoded
Cookie:wdc-session=w0srLHI6Tz9tDLtEDo0n33PNuXSFexxysEHBa9v5dtjXBt/X4cKb9zKdxoVrtyDKseewwZMbU41vn3DLmyf0QUUjtKwXdmEhHtS69aZf94Y26cqd95rsiCKg06SQVIm5p63me/C2chBBapoABa1lJ8lf4F3MbBIiBAnCnbKlgVfXtsjpijt9i2PMILjlAalr
Host:oktap.tax.ok.gov
Origin:https://oktap.tax.ok.gov
Referer:https://oktap.tax.ok.gov/oktap/web/_/
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.4 Chrome/31.0.1650.4 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Dataview sourceview URL encoded
D0IHwpHb__0_0_Ful0QW:5
VIEW__:VS_PermitSearch
LASTFOCUSFIELD__:D0IHwpHb__0_0_Ful0QW
DOC_MODAL_ID__:0
FAST_VERLAST__:3.2sMmdbnwgvAQF41H3c_2XHozyeA1
Response Headersview source
Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Content-Encoding:gzip
Content-Language:en, en-US
Content-Length:318
Content-Type:application/json; charset=utf-8
Date:Thu, 03 Oct 2013 19:52:52 GMT
Expires:Fri, 01 Jan 1990 00:00:00 GMT
Pragma:no-cache
Server:Microsoft-HTTPAPI/2.0
Set-Cookie:wdc-session=w0srLHI6Tz9tDLtEDo0n33PNuXSFexxysEHBa9v5dtjXBt/X4cKb9zKdxoVrtyDKseewwZMbU41vn3DLmyf0QUUjtKwXdmEhHtS69aZf94Y26cqd95rsiCKg06SQVIm5p63me/C2chBBapoABa1lJ8lf4F3MbBIiBAnCnbKlgVfXtsjpijt9i2PMILjlAalr; path=/oktap/web/; HttpOnly; Secure;
X-Frame-Options:DENY

Request URL:https://oktap.tax.ok.gov/oktap/web/_/EventOccurred
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:226
Content-Type:application/x-www-form-urlencoded
Cookie:wdc-session=w0srLHI6Tz9tDLtEDo0n33PNuXSFexxysEHBa9v5dtjXBt/X4cKb9zKdxoVrtyDKseewwZMbU41vn3DLmyf0QUUjtKwXdmEhHtS69aZf94Y26cqd95rsiCKg06SQVIm5p63me/C2chBBapoABa1lJ8lf4F3MbBIiBAnCnbKlgVfXtsjpijt9i2PMILjlAalr
Host:oktap.tax.ok.gov
Origin:https://oktap.tax.ok.gov
Referer:https://oktap.tax.ok.gov/oktap/web/_/
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.4 Chrome/31.0.1650.4 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Dataview sourceview URL encoded
D0IHwpHb__0_0_Ful0QW:5
VIEW__:VS_PermitSearch
LASTFOCUSFIELD__:D0IHwpHb__0_0_Ful0QW
DOC_MODAL_ID__:0
EVENT__:D0IHwpHb__0_0_Ful0QW
DOC_ACTION__:false
TYPE__:1
CLOSECONFIRMED__:false
FAST_VERLAST__:4.Ol_i_B9mDsWsP0Mg0e02_y7OZjM1
Response Headersview source
Cache-Control:no-cache, no-store, max-age=0, must-revalidate
Content-Encoding:gzip
Content-Language:en, en-US
Content-Length:3711
Content-Type:application/json; charset=utf-8
Date:Thu, 03 Oct 2013 19:52:52 GMT
Expires:Fri, 01 Jan 1990 00:00:00 GMT
Pragma:no-cache
Server:Microsoft-HTTPAPI/2.0
Set-Cookie:wdc-session=w0srLHI6Tz9tDLtEDo0n33PNuXSFexxysEHBa9v5dtjXBt/X4cKb9zKdxoVrtyDKseewwZMbU41vn3DLmyf0QUUjtKwXdmEhHtS69aZf94Y26cqd95rsiCKg06SQVIm5p63me/C2chBBapoABa1lJ8lf4F3MbBIiBAnCnbKlgVfXtsjpijt9i2PMILjlAalr; path=/oktap/web/; HttpOnly; Secure;
X-Frame-Options:DENY

1 个答案:

答案 0 :(得分:1)

作为该公司的开发人员,我不建议以这种方式查找许可证。每年150美元,您可以获得包含此信息的文件。

联系OTC。 http://www.tax.ok.gov/rules/rule6507.pdf - 710:65-9-6。订阅销售税许可证清单