Android Volley gives me 400 error
本文来自:http://stackoverflow.com/questions/21739276/android-volley-gives-me-400-error
本人是根据文中的其中一方法:
I had the same problem and i removed from the header:
headers.put("Content-Type", "application/json");
now it works great!
以下是全文
I'm trying to make a
I get the following error:
I have seen a lot of examples and I don't really see what is going wrong here. Anyone any idea? I updated the code with this method:
and changed
Still getting the same error! |
|||||||||||||||||||||
|
I had the same problem and i removed from the header:
now it works great!
|
|||||
|
400 indicates a bad request, maybe you're missing |
|||||||||||||||||||||
|
I've got this error and now Iit's been fixed. I did what is told in this link. What you need to do is
with
Hope this helps. |
||||
I have removed this params.put("Content-Type", "application/x-www-form-urlencoded"); This is my Code Change.
|
|||
I have the same issue before and I got the solution in my project:
In the code Snippet above I used Post Method: My answer is base on my experience and so take note: 1.) When using POST method use "StringRequest" instead of "JsonObjectRequest" 2.) inside getHeaders Override the value with an Empty HashMap
And everything works in my case. |
|||
In Android 2.3 there is a problem using Base64.encodeToString() as it introduces a new line in HTTP header. See my response to this question here in SO. Short answer: Don't use Base64.encodeToString() but put the already encoded String there. |
||||
400 error is because Content-Type is set wrong. Please do the following.
|
|||
There can be multiple reasons for this error. One ofcouse as said by others is, maybe you are missing or have improperly set 'Content-type' header. If you are properly implemented that, other possible reason is that you are sending params directly from your url. There may be a case when params is a string with some white spaces in it. These white spaces cause problem in GET requests through volley. You need to find another way around it. Thats all. |
|||||||||
|
最新文章
- IOS 杂笔-15(知识小点 readonly)
- C#语言的基础
- PHP上传文件详解 错误提示
- “FormCRUD.csProj.FormMain.Name”隐藏了继承的成员“System.Windows.Forms.Control.Name”。如果是有意隐藏,请使用关键字 new。
- 【v2.x OGE教程 19】 引擎状态控制
- Memcached总结二:Memcached环境安装设置以及连接memcache服务器
- javascript获取host
- 【译】在Asp.Net中操作PDF – iTextSharp-列表
- eclipse搭建ssh后台
- Hadoop yarn任务调度策略介绍(转)
- kubernetes核心概念
- 关于Unity中物体分别在本地和世界坐标系对应方向的移动
- (在命名空间 public 中)存在冲突
- 【Vue】---编写Vue插件流程---【巷子】
- Cassandra基础
- 如何搭建http服务仓库
- iOS开发消息推送原理
- CAD打开慢,卡在99%
- 三、为什么String在Java中是不可更改的
- 一款基于jquery和css3实现的摩天轮式分享按钮
热门文章
- iOS程序启动过程
- walk around by The provided App differs from another App with the same version and product ID 分类: Sharepoint 2015-07-05 08:14 4人阅读 评论(0) 收藏
- listview指定某item的点击效果
- RHEL6.4编译安装企业级LAMMP平台
- sql inner join , left join, right join , union,union all 的用法和区别
- MYSQL单双向同步
- GoldenGate Studio 12.2.1.1发布
- iOS 上拉下拉刷新简单实现代码
- How to upgrade Subversion on OSX
- valueForKeyPath常用用法