server-response

How can I return static files in PHP?

亡梦爱人 提交于 2019-12-14 03:53:33
问题 I use a .htaccess file to redirect all requests to the same index.php . From there, I decide what to do depending on URL of the incoming request. For now, I map the request URL to directory structure relative to a source folder, so that example.com/user/create maps to source/user/create/index.php . The file located there can handle the request as needed, and generate HTML output. But that doesn't work for static assets, the browser may request. So my idea is to find out whether a request URL

Create Android layout with buttons from server response

拥有回忆 提交于 2019-12-10 12:12:55
问题 I checked around and and I can never quite find something that helps me with what I am trying to accomplish. In my Android app I want to be able to make a request to the server for some data, when that data is returned I want to populate a scrollview because there is too much to fit in one display. The reason I am doing this is because the data will be updated too often for me to do continuous updates of the app (imaginee twitter). I've already built out the XML linearlayout which will

NSURLSessionUploadTask how to read server response

允我心安 提交于 2019-12-08 15:00:32
问题 I am using NSURLSessionUploadTask to upload a file. Here are some parts of my code not complete let session:NSURLSession = NSURLSession(configuration: config, delegate: self, delegateQueue: NSOperationQueue .mainQueue()) let sessionTask:NSURLSessionUploadTask = session.uploadTaskWithStreamedRequest(request But the problem is I am unable to get the JSON response the server sends back. The following delegate also not firing but other delegates are firing func URLSession(session: NSURLSession,

Handle Server Response in Android

半腔热情 提交于 2019-12-04 02:33:13
问题 In my application I am fetching data using webservices.But when the server is down or not in active state it gives response code 500 and my application force close. Please guide me how to handle this condition in my application.The logcat output is shown below : 12-05 12:17:22.337: V/response code(950): 500 12-05 12:17:22.347: W/System.err(950): org.json.JSONException: A JSONArray text must start with '[' at character 1 of <html> 12-05 12:17:22.347: W/System.err(950): <head> 12-05 12:17:22

Handle Server Response in Android

只愿长相守 提交于 2019-12-01 14:30:51
In my application I am fetching data using webservices.But when the server is down or not in active state it gives response code 500 and my application force close. Please guide me how to handle this condition in my application.The logcat output is shown below : 12-05 12:17:22.337: V/response code(950): 500 12-05 12:17:22.347: W/System.err(950): org.json.JSONException: A JSONArray text must start with '[' at character 1 of <html> 12-05 12:17:22.347: W/System.err(950): <head> 12-05 12:17:22.347: W/System.err(950): <title>Configuration Error</title> 12-05 12:17:22.347: W/System.err(950): <style>

What exactly is the 'Waiting for response' msg on Firebug's Net tab?

心不动则不痛 提交于 2019-11-30 03:04:12
As sou can see from the screenshot most of the time spent is waiting for a server response (thats the purple coloured area). What exactly is that server response time? Is the server too slow? Is my connection too slow? Can't the server process much information at once (I've got many files there, I know I'll combine them to fewer)? What do I have to do to minimise that waiting time? PS. all the data are on the same server but I'm using subdomains so that the browser can process more files at once. This article is quite nice about features of firebug : Introduction to Firebug: Net Panel

What exactly is the 'Waiting for response' msg on Firebug's Net tab?

£可爱£侵袭症+ 提交于 2019-11-29 00:46:50
问题 As sou can see from the screenshot most of the time spent is waiting for a server response (thats the purple coloured area). What exactly is that server response time? Is the server too slow? Is my connection too slow? Can't the server process much information at once (I've got many files there, I know I'll combine them to fewer)? What do I have to do to minimise that waiting time? PS. all the data are on the same server but I'm using subdomains so that the browser can process more files at

Why does Firebug show a “206 Partial Content” response on a video loading request?

微笑、不失礼 提交于 2019-11-27 13:38:20
I have a bunch of html5 video elements, with their preload attribute set to "auto". They start loading just fine, but I think there might be a problem with their caching, because each time I reload the page (without clearing the cache), they start all over again. When I checked the Network panel in firebug, I noticed everything else (images and files) was giving me a "304 not modified" message as espected, while the videos (and audio) files were giving me a "206 partial content" message, in duplicated entries. The "206 partial content" response also appears in duplicated entries when the page

Why does Firebug show a “206 Partial Content” response on a video loading request?

删除回忆录丶 提交于 2019-11-26 16:25:49
问题 I have a bunch of html5 video elements, with their preload attribute set to "auto". They start loading just fine, but I think there might be a problem with their caching, because each time I reload the page (without clearing the cache), they start all over again. When I checked the Network panel in firebug, I noticed everything else (images and files) was giving me a "304 not modified" message as espected, while the videos (and audio) files were giving me a "206 partial content" message, in