android :error in updating data on my server - php

i am working in android. i have uploaded my database and APIs on my server. when i call a get API. then it works fine. But when i call POST API like as Registration then it creates problem and does not respond.
this is the problem in my LogCat
Some possible problems are:
Missing or unknown request method.
Missing URL.
Missing HTTP Identifier (HTTP/1.0).
Request is too large.
Content-Length missing for POST or PUT requests.
Illegal character in hostname; underscores are not allowed.
HTTP/1.1 Expect: feature is being asked from an HTTP/1.0 software.
when use API and database which is stored on my localhost then everything works fine.. please help me to find out the reason of error... is this related to proxy or something else. yes i activated proxy on my server.
if you want to ask anything related to my question then i am 24 hours available here..
this is the error page. please visit this link...
http://www.2shared.com/document/zTO7-x/error.html
please see my problem.
Thank you in advance...

I have done this by my self experience... this problem is created just because of my server proxy setting.
I allow that application from my server proxy then it working fine...
Thank you all who tried to help me...

Related

POSTMAN continue loading the request forever without any reply

I am using the native app's latest version and it was working good but suddenly this problem appeared still loading the request without any reply.
I tried to reinstall it but nothing changed a tried the environment variables for the postman and still the problem. What can I do? Please help. Thanks.
For anyone reading this: problem was that I was not connected to my database. I needed to whitelist my IP address in MongoDB Atlas.
Just so I'm not spamming SO, you can check out my full answer here: https://stackoverflow.com/a/58263695/11993942

Ionic/Angular $http.get returning Response for preflight has invalid HTTP status code 404

I am developing an application in IONIC. I am making a $http.get request in Angular JS and its giving me 404 error when I successfully login and trying to load the user profile using the token sent in the authentication header.
It produces error in chrome, although I enabled CORS. Please check the screenshot:
Now if I try the url in POSTMAN, everything is ok. See the screenshot below:
I am stuck with this error, can someone help me?
What Ionic says
There are two ways to solve the issue: The first, and easier, solution is to just allow all origins from your API endpoint. However, we can’t always control the endpoint we are accessing. What we need, then, is a request that does not specify an origin.
We can do this by using a proxy server. Let’s look how the Ionic CLI provides
Reference
What works but isn't completely good to use
A simple solution is just add a CORS plugin into your browser and everything will work.
Plugin Link
Proxy server
If you want a proxy server there is this tutorial:
Link

Getting invalid status line 10380HTTP/1.1 200 OK

It's driving me crazy. I created an Android App that does REST requests to an Apache Server running CakePHP 2.X.
In Android side: the request are make using Volley from Google it's HEAD version.
In Server side: It's a Apache 2, PHP 5.4, CakePHP 2.x and SSL.
Whatever request method GET or POST, with the same URL or same parameters when POST, sometimes the response is fine others time I get com.android.volley.NoConnectionError: java.net.ProtocolException: Unexpected status line: 10380HTTP/1.1 200 OK
When the error happen, the only thing i noticed is the number before changes. 10380HTTP/1.1 200 OK.
Any idea?
Thanks
I could sniff the request/response and could confirm it's a server side issue.
With information from #Julian Reschke and #AD7six
Apparently it's common error when using keep-alive and the second,third,etc response was messing up.
So following the information i got from this post, the problem looks like solved (I'll keep testing it).

POST request being received as GET request on Heroku

Why aren't the POST params that are being set by a html form on another domain being received by my PHP script being hosted by Heroku?
Context:
I've got a simple html form which is sending some user data to a PHP script I've put on Heroku. The form is on a different site/domain, but as I understand the Same Origin Policy shouldn't be breaking the request. In fact, I've tested sending the request from the form to my local machine and the script worked fine.
The request fires perfectly normally from the html form, but by the time it gets to my PHP script, the $_POST array is empty. After checking the Heroku logs, it actually looks like the POST request gets received as a GET by my script.
Is there simply a config/routing thing I haven't done (I'm new to Heroku)?
I took a look at a couple of other questions/answers like this one, but no solution has worked yet for me.
Many thanks in advance for help
UPDATE 1 (4/4/12)
It appears that the POST requests are being moved as CoR has described in his answer. I can't figure out how to stop this from happening though. From researching around, it appears that this moving of POST requests only happens if you're not making them via https.
For now I've submitted and changed the forms method to GET, which works fine. It would of course be nice to know if one can enable POST requests on their Heroku app without setting up SSL.
UPDATE 2 (6/4/12)
I've just opened a ticket with Heroku to find out whether the only way to support POST requests is if you enable SSL. I of course looked through their docs for an answer before asking it here, but nothing relating to POSTs being moved as CoR has answered is described. I will post (😉...😪) answer on here when they get back to me.
Okay! Finally got it! After one of the super awesome Heroku team getting back to me in like 10 mins, it turned out to be a silly error.
My form was sending it's request to http://MYAPP.heroku.com, whereas one's Heroku app is actually at http://MYAPP.herokuapp.com. That's all. So obviously my request was getting moved when it was sent to http://MYAPP.heroku.com.
What's more, when (correctly) using the herokuapp.comdomain, you can send requests over HTTPS, although sending POST requests over HTTP will work fine.
The SLL Add-On is only if you have a custom domain and would like to enable SSL for it.
It took me few days to chew url redirection to understandable definitions.
Here they are:
301 – Permanently moved: breaks POST
302 – Temporarily moved: legacy, will change POST to GET
303 - Temporarily moved: WILL change POST to GET
307 - Temporarily moved: NOT change POST to GET
EDIT:
it appears that this moving of POST requests only happens if you're
not making them via https.
Yes, I forgot that people are using redirections usually to unify trailing slash, www. AND enforce http or https protocol.
As you might have guesses 301 or 302 redirections can break POST. Fix it by using 307 or write to website admin and he may or may not 'fix it'.
It depends if it will break something else, or maybe that website want to force it users to always use https! In that case 301 is desirable solution because sending POST over unsecure http protocol is automatically discarded/transformed to GET request.
It doesn't matter if server is using https if for example first login data was send by http.
It would of course be nice to know if one can enable POST requests on
their Heroku app without setting up SSL.
Although technically possible, it is valid server policy to disable POST over http and enforce it to use only https.

Facebook graph api doesn't response on real host but work fine in localhost

I had been using my written script for months and just from few days ago facebook stop responding ( it take forever to loads ) when the request is made from my host, but the same exact codes work fine when run in localhost.
I had been using curl method to get the group feed https://developers.facebook.com/docs/graph-api/reference/v2.0/group/members
file_get_contents("https://graph.facebook.com/489360131076423/feed/?access_token=APPID|SECRETCODE")
which still work fine in localhost but not in server. Then i also tried using "PHP SDK" method still having the same problem.
My setting in facebook developer is too seems to correct (it was working before too) as I have two domain allowed in App Domains setting which are "localhost" and "xxxxxxxx.im" ( my domain is .im not .com and obviously in xxxx i have my domain name written)
The question is
1. Can anyone suggest what could be the problem ?
2. Any suggestion for debugging this? because i don't get response at all. So no idea about any request error :(
Thanks :)
Try using ob_start(); function in the starting of page

Categories