考虑函数
public JsonResult poststuff()
{
var form = Request.Form;
return new JsonResult() { Data = form };
}
考虑提交的数据(JSON)
{
name: "John Doe",
age: "50"
}
,这是我的问题,
有任何方法将post数据作为JSON返回吗?而不必将数据拆开并插入到一个类型的对象中?
我觉得我一直在网上搜寻答案,但一直找不到答案.知道我会求助于你。
如果这是个新手问题,我很抱歉。
在我的应用程序中,我正在使用tntseach a s我的拉拉球探驱动程序和serach系统。
它目前运行良好,但唯一的问题是,我收到的结果的格式。
如果我搜索“视频”( )
我得到["Video post"] as the result.It is correct but I want the result to be just视频后(省略括号和双引号)。
如果我为“帖子”说教
我得到:
“我的第一个帖子”,“视频帖子”,“帖子”
我希望它是:
My first posts
Video post
posts
我试过json_decode(),但
假设我的JSON是这样的:
{
"achievement": [
{
"title": "All Around Submitter",
"description": "Get one piece of content approved in all six areas.",
"xp": 500,
"level_req": 1
},
{
"title": "World-wid
我有一个应用程序,可以在ListView中显示数据库中的所有项目。但是我有个问题,我只得到了数据库中的第一个元素。
这是我的PHP代码:
<?php
$response = array();
// include db connect class
require_once __DIR__ . '/db_connect.php';
// connecting to db
$db = new DB_CONNECT();
$dbh = $db->connect(); // here you get the connection
$query = "SELE