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).
Related
does this API just not work via cross origin resource? My CORS headers are set in .htaccess and verified working, because I do get a response from the API, but it's an unknown error.
I set everything up and tested on a single test server and it all works. But my prod environment requires two separate domains, one which is a CMS where the pages are hosted, and then a separate PHP server where I'm hosting the PHP side of the app that makes the CURL requests. When I try to make a CORS request, I get
{"error":{"code":500000,"message":"An unexpected error occurred. If the error persists, report it with date/time of error, request identifier from response header X-RequestId, and client identifier from request header X-ClientTraceId."}}
I get the same thing when I mimic a CORS scenario locally by using a XAMPP PHP server and a Gulp HTTP server.
My setup currently builds the JSON from body copy on a page, then sends that via AJAX POST to the PHP file, which then processes it, encodes, makes Curl requests to the API, then outputs the response. I then handle the data from the response again in the JS file.
I have been using the Maps API service for a month now. This morning I found that the service has stopped working. Any request to maps.googleapis.com causes my server to hang for a moment and then display the internal server 500 error.
At first I thought I was blocked / banned by google and there must be something I have overlooked with the t and c's but having looked further there are no notifications in my google api dev console.
If I make a request from another server using the same API key it works.
If I make a request directly in the url bar with the same API key it also works.
It only hangs and causes a 500 error for the domain maps.googleapis.com and not any other. I am guessing that Google has blocked my server IP but it seems odd that they would do this and my API key still works fine. If they had blocked me it wouldn't it be the whole API account?
Firstly, how do I know if I am blocked?
Secondly, why do I not get a error from google saying what the issue is?
Why does it cause my server to issue a 500 error? If my server is blocked it wouldn't just respond to say whatever the API problem is?
All seem very strange to me. It only started today. I am hitting the API with file_get_contents using php 5.1 on an apache server.
To clarify, the 500 error is on my server, I cannot see any response from the http request because it hangs and then spits out the 500 error.
And now after 3 hours of debugging it works for no explained reason. The only possibility that i can think of is that the hosting company has been doing maintenance and something they changed caused this. after waiting on hold for 20 minuts they disconnected but perhaps they looked into it behind the scenes for me. Pretty annoyed a whole morning waisted and although im happy it has resolved its still frustrating to not know what or why
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
I have a GWT app and I'm using RequestBuilder get GET some json from a php script I have running on a Fatcow.com server. It returns the json just fine in the browser and returns a 200 status in Charles web debug proxy, but in the GWT app it always says the response status is 0 and doesn't give me any json. When I test my code on a known working URL, it returns 200 and I get the json I expect. Also, I already have header('Content-Type: application/json; charset=utf-8'); in my php, which I know is a common error. Is there any reason this would not be working? Is it a php thing, or am I doing something wrong?
You're hitting the Same-Origin Policy.
CORS is supported in most recent browsers (exceptions: IE and Opera; will be coming in IE 10 and Opera 12 respectively).
Only viable alternatives are JSONP (using JsonpRequestBuilder in GWT) or a "proxy" on the same server serving your GWT app.
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...