我如何能够获取单个字段并从包含json输入的url中获取整个数据 [英] How I able to take individual field and take entire data from url which contain json input

查看:71
本文介绍了我如何能够获取单个字段并从包含json输入的url中获取整个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想出了一个情况,我将我的aspx页面提供给服务器端ppl,他们将json数据附加到我的页面。我想把那个json数据插入到table1.Suppose json数据包含10个字段,我想采取其中5个并插入table2。



这是我的网址。



 http://domainname.com/pagename.aspx?{'data':'{Location:xxxxxx,Apikey:xxxxxxxxxxxxx,
技能:xxxxxx, PhoneName:xxxxxxxxxx,Type:xxxxxxx,Address:xxxx,Pincode:xxxx
}'}





我尝试过:



 http:// domainname。 com / pagename.aspx?{'data':'{Location:xxxxxx,Apikey:xxxxxxxxxxxxx,
技能:xxxxxx,PhoneName:xxxxxxxxxx,输入:xxxxxxx,地址:xxxx,Pincode:xxxx
}'}

解决方案

首先我们要分离json对象。

这里对象=

 {Location:xxxxxx,Apikey:xxx xxxxxxxxxx,
技能:xxxxxx,PhoneName:xxxxxxxxxx,类型:xxxxxxx,地址:xxxx,Pincode:xxxx
}





然后object.Location将分别给出

xxxxxx

和其他值


I came up with situation where I will give my aspx page to serverside ppl,they append json data to my page.I want to take that json data and insert into table1.Suppose json data contain 10 field,I want to take 5 out of them and insert into table2.

Here is my url.

http://domainname.com/pagename.aspx?{'data':'{"Location": "xxxxxx","Apikey": "xxxxxxxxxxxxx",
"Skill": "xxxxxx","PhoneName": "xxxxxxxxxx","Type": "xxxxxxx","Address":"xxxx","Pincode":"xxxx"
}'}



What I have tried:

http://domainname.com/pagename.aspx?{'data':'{"Location": "xxxxxx","Apikey": "xxxxxxxxxxxxx",
"Skill": "xxxxxx","PhoneName": "xxxxxxxxxx","Type": "xxxxxxx","Address":"xxxx","Pincode":"xxxx"
}'}

解决方案

First we have to separate the json object.
Here the object =

{"Location": "xxxxxx","Apikey": "xxxxxxxxxxxxx",
"Skill": "xxxxxx","PhoneName": "xxxxxxxxxx","Type": "xxxxxxx","Address":"xxxx","Pincode":"xxxx"
}



Then object.Location will give

"xxxxxx"

and other values respectively.


这篇关于我如何能够获取单个字段并从包含json输入的url中获取整个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆