服务器正在以HTTP的形式发送JSON中的数据,我正在使用jax-rs来处理和检索数据。
我可以根据我想要的内容使用@Pathparam或@queryparam,但这两种方法中的数据都不喜欢。如果我是对的,也不会出现在标题中,因为它们包含一些内容类型、日期和一些类似的内容。如何从POST检索数据?
@POST
@Path("/foo")
public void foo(){ //do i need to put sth in parameter paranthesis to get?
//handle the data!! but how??
}
通过HTTP,我将以下json发送到我的webservice,并由return new Response($request->getContent());验证
{"company_id":13}
在我的webservice中,我试图通过它的标记从请求中检索数据:
var_dump("COMPANY ID ".$request->request->getInt('company_id')); //returns 0
我也试过:
//the 2 below should only work on GET from what I re
我们正在尝试从Firebase实时数据库中检索数据。
当我们尝试使用PostMan将Firebase中显示的URL添加到我们的项目数据中,并在末尾添加".json“,如下所示...
https://our_project.firebaseio.com/rest/our_data.json
...we收到"user not authenticated“错误。
如果我们尝试使用该URL检索数据,使用web api密钥,如下所示...
https://our_project.firebaseio.com/rest/our_data.json?auth=[our web api k
def frontblog(request):
if request.method=='POST':
for post in Posts.objects(tags=request.POST('search')):
posttitle=post.post_title
postcont=post.post_content
postdate=post.post_date
posttag=post.post_tags
return render_
我试图从HttpRequest post正文中检索字节数组。post主体包含具有两个属性的对象。1."Id“的类型为string和2。“数据”是byte[]类型的。
Data属性包含使用代码转换为字节数组的文件数据:
Data = File.ReadAllBytes("fileName");
var responseObj = JObject.Parse(await new StreamReader(request.Body).ReadToEndAsync());
string id = responseObj["Id"].Value<stri
在传递从$.post()函数检索到的数据以在代码中的其他位置使用时,我遇到了问题。我希望将数据保存为变量,并在post()函数外部使用它。这是我的代码:
var last_update = function() {
$.post('/--/feed',
{func:'latest', who:$.defaults.login},
function($j){
_j = JSON.parse($j);
alert(_j.text); // This one works
});
}
ale