response

Is it necessary to set the Content-Length in my response header?

I'm reviewing some legacy code and I've found a bug that causes the response to sit indefinitely. Here's the basic idea: Response.Content-Type = "application/octet-stream" Response.AddHeader("Content-Disposition", "attachment; filename" & someFileName) Response.AddHeader("Content-Length", someStoredLength) Response.BinaryWrite(someByte...

$('#my_form').ajaxForm opening PHP page instead of reloading content (Safari,Chrome)

Hi, My ajaxForm request is not working properly in Safari and Chrome. Instead of getting the response from php file it opens it as a new page. (Works fine in FF, IE, Opera): $('#my_form').ajaxForm({ success: finished }); function finished(responseText, statusText) { ... } Thanks for your help! ...

Compacting HTTP Response Headers?

I had asked a few questions regarding compressing HTTP Request headers here and here but I some how skipped the HTTP response part... I am looking for a way to reduce/compact the headers in my HTTP response... The situation is that I am communicating a Java ME app with a remote Server and any extra baggage is causing me to shed out load...

Ajax response empty string when triggered via form onsubmit in firefox, but working fine in internet explorer and opera (works in firefox if send by submit button instead of form onsubmit)

Ajax response empty string when triggered via form onsubmit in firefox, but working fine in internet explorer and opera (works in firefox if send by submit button instead of form onsubmit) I am simply calling a php file with the ajax GET and the php file response with - echo $response = "something"; . Then the response value is alerted...

jquery ajax error json response

i have jquery global error event set, like following: $("#message_alert").ajaxError(function(event, XMLHttpRequest, settings, thrownError){ ajax_error(XMLHttpRequest); }); and ajax_error method gets the XMLHttpRequest parameter totally fine init. now the request which XMLHttpRequest gets, it also have json data from the backend in...

StreamWriter Response output - looks fine in Notepad but accents are garbage in Excel

Hi there, I'm using a technique from another stackoverflow question here, to write a CSV file to the Response output for a User to Open/Save. This is working fine and the file looks good in Notepad, but when I open it in Excel the accented characters are garbage. I assumed this was something to do with the character encoding, so tried m...

How to clear a parent response content from a usercontrol in asp.net?

Hi all, I have a page that has 4 different usercontrols on it. At a certain point I need to make a redirection using javascript location.replace() and it cannot be made through server. It has to be client side. So, what I need is call the Response.Clear() in parent page from the usercontrol so nothing else will be written in the page. ...

Modify Http response

Hi, I have a need to write a Servlet filter to inspect the HTML being sent out and modify all the links that point to /images in it to a different domain altogether so that they are served from a CDN(content delivery network) rather than my site. Is this recommended and how can I achieve this? -thanks ...

Efficient way to communicate between Flash and MySql?

What is the best/fast/efficient way of communicate between Flash and MySql? I have a multi-players online game using Flash-php-MySql, it seems like when I reach 5 or more players, the game is laggy. And I believe that problem is because of request and response from MySql through php. I am using URLRequest, Post method in AS3 file. I tri...

WCF service to return iCal

How do I get my service written with WCF to return an iCal? The examples I see use either xml or json as the way to format the response. What is the best way to return other types of response bodies? ...

RESTful API response status code disambiguation

I'm developing a RESTful API and have a question about the most appropriate response status codes for certain scenarios. Consider the case where the client makes a GET request for a resource. How can I disambiguate a "not found" response for the case where the resource legitimately does not exist, vs. the case where there may be a minor...

jquery find if its json or xml

i want to know if the response is the json or xml, how can i find that out using jquery? my current code is following, but its giving error, if response is json. var is_xml = ($('status_code', XMLHttpRequest.responseText)) ? true : false; error is: Selector expected. Expected ',' or '{' but found '"}}"'. ...

HTTP/1.1 Cache-Control no-cache problem

I do not want my Java SWT application to cache temporary internet files. Currently I am dealing with IE (because SWT uses the native browser), and the browser cannot be changed. The "Cache-Control: no-cache" seems to work fine for every file type I display, except wmv. My "Expires" is set to 0. I have tried all kinds of cache control co...

feed text parser

I'm getting text from an API and it's something like following: text = 'replied to @james and he was visiting this http://some-site.com/another/something/../ so what you think about it'; How can I parse this text and make links as html links and @james as html links also, but with their own href values. Does anyone know any function ...

How to return XML in an Zend Framework Application

Hi all, I'm having problems returning XML in my ZF Application. Below is the code I have: <?php class ProjectsController extends Gid_Controller_Action { public function xmlAction () { $content = "<?xml version='1.0'><foo>bar</foo>"; header('Content-Type: text/xml'); echo $content; } } ?> I've also tried the following: <?php...

ASP.NET Response Filter to Reformat the rendered output of ASPX pages?

Hi all, I've created a simple HttpModule and response stream to reformat the rendered output of web pages (see code snippets below). In the HttpModule I set the Response.Filter to my PageStream: m_Application.Context.Response.Filter = new PageStream(m_Application.Context); In the PageStream I overwrite the Write method in order to d...

How to get the response?

Hello! My problem would be that I make a POST request with jqurery, and if there is an error I modify the HTTP status to for example 401 and echo the error. (I'm using $.ajax();) So, the problem is that I don't know how to print out that error message. If I check it in firebug I get something like this: {"*THE URL OF THE FILE*":{"rc":4...

Why does HttpUtility.UrlEncode(HttpUtility.UrlDecode("%20")) return + instead of %20?

I'm having a problem with a file download where the download is replacing all the spaces with underscores. Basically I'm getting a problem here: Response.AddHeader("Content-Disposition", "attachment; filename=" + someFileName); The problem is that if someFileName had a space in it such as "check this out.txt" then the user would...

jQuery .find() in server response

I am trying to get the text inside a specific div in a server response. I used Firebug to see what the response was, and I can see my element in the returned code, but for some reason I can get jQuery to capture it. Here is what I am using: var response = $('<div />').html(serverData); $('#uploadedFiles').html($(response).find("#creat...

jquery autocomplete with json response

im getting response in json, but this wont parse the json response. what m i doing wrong? i could'nt find anything on doc http://docs.jquery.com/Plugins/Autocomplete $("#users-allowed").autocomplete("/people/following.json", { width: 320, // max: 4, highlight: false, scroll: true, scrollHeight: ...