我如何通过url获取json

时间:2019-06-28 06:52:29

标签: json xmlhttprequest

我想从网站上获取一些数据,它似乎是由asp.net编写的。我想要的是通过chorme并输入一些url,例如'https:xxx.xxxxx.com?xxx = xx&xx = xxxx ',它将返回一些json数据。

这是网站:http://iom.inman.cc/ProductPurchaseScheduleView
并通过chorme的F12按钮,明显的数据存在于文件名“读取”中,我检查了表单数据,显示“ sort =&page = 1&pageSize = 15&group =&filter = ProductProductSN〜contains〜'1433'”, 我的搜寻条件是1433 所以我尝试输入“ http://iom.inman.cc/ProductPurchaseScheduleView/Read?sort=&page=1&pageSize=15&group=&filter=ProductProductSN~contains~'1433'”, 但是它警告我“找不到文件”。 在它旁边,当我单击它时,它们具有链接名称“ export to csv”,并显示链接“ http://iom.inman.cc/ProductPurchaseScheduleView/Export?sort=&group=&filter=ProductProductSN~contains~%271107%27&=&” 1107是我的搜索条件,我尝试使用“读取”代替“导出”,但是我失败了。

我正在使用google chorme浏览器,这是有关文件'Read'的一些信息。

Headers
General
Request URL: http://iom.inman.cc/ProductPurchaseScheduleView/Read
Request Method: POST
Status Code: 200 OK
Remote Address: 40.73.79.52:80
Referrer Policy: no-referrer-when-downgrade

Response Header
Access-Control-Allow-Origin: *
Cache-Control: private, s-maxage=0
Content-Length: 2581
Content-Type: application/json; charset=utf-8
Date: Fri, 28 Jun 2019 06:06:18 GMT
Server: Microsoft-IIS/8.5
Set-Cookie: sys.customer=e1fbe8cf-066b-4541-8844-3ef6ced8c923; path=/; HttpOnly
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 5.2
X-Powered-By: ASP.NET

Request Headers 
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh,en;q=0.9,zh-CN;q=0.8
Connection: keep-alive
Content-Length: 71
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: ASP.NET_SessionId=f4heq2jgyecfaxl0liomgfo5; sys.customer=e1fbe8cf-066b-4541-8844-3ef6ced8c923; Inman.SCM.AUTH=CFF8E1E64D324186DFE755BE3684B3EAEA83222D4AD824B65A34D7B2929F579AA4105B7294DBE232B750DFD0F85AC954662397EE7D87AFF72130D30F12E822EF77A82DA05F0D0A6665D8672DE127864B03BDB3E2BDE7C1A8B92EC2CCD98CEF512EBBDB03ACAE746251A98DB92711274551482AC4FB2FF3AF989A6ACA163036A2D164032E7B8115E1A1EA196C4A081D5A75913494FF6924B6F26E7B0B728A2378E8D65D648772900BD57E57DE7D56ED5B8FA03AE6D301C5204591404F9E7A6E1F434EB51AC11159FA3CD9A47B6E8993608F6A8D24BB679E2A1125CF1B01F125A3B7FA760C1648679DDA51B356CD3825154B7981D33C0E0C9D15482CE13BAFF6542F03E40976FE24D256EE7F9B26E484C118625CD1CD584B8C193C8378DED4D685E84B1AE6DEDA2635ADCC4CED2002E1EE8E23E7CC5D4385400C0AC9D632F805BC
Host: iom.inman.cc
Origin: http://iom.inman.cc
Referer: http://iom.inman.cc/ProductPurchaseScheduleView
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
X-Requested-With: XMLHttpRequest


Form Data
sort: 
page: 1
pageSize: 15
group: 
filter: ProductProductSN~contains~'1433'

Response
{"Data":[{"PurchaseOrderStatus":"xxx","ProduceScheduleStatus":"xxx","PurchaseOrderDocMode":"FOB","PurchaseOrderDocNum":"CPCG19667388","PurchaseOrderCreatedOn":"\/Date(1561423724763)\/","PurchaseOrderCreatedBy":"xx","ProduceScheduleFactoryName":"xx","PurchaseOrderMerchandiser":"xx","DocNum":"ZD190600000058",}]

我希望输入“ http://iom.inman.cc/ProductPurchaseScheduleView?xx=xxx”,它将返回正确的json数据

0 个答案:

没有答案