How to send a referer request in a url for a webView

For which API-level do you need that function? Since API Level 8 there is a second loadUrl function: public void loadUrl (String url, Map<String, String> extraHeaders) With the extraHeaders you should be able to send a referrer. EDIT: Here is a complete working example: String url = “http://www.targetserver.tld/”; Map<String, String> extraHeaders = new HashMap<String, String>(); … Read more

Unicode in Content-Disposition header

I had similar problem. You have to use HttpUtility.UrlEncode or Server.UrlEncode to encode filename. Also I remember firefox didn’t need it. Moreoverit ruined filename when it’s url-encoded. My code: // IE needs url encoding, FF doesn’t support it, Google Chrome doesn’t care if (Request.Browser.IsBrowser (“IE”)) { fileName = Server.UrlEncode(fileName); } Response.Clear (); Response.AddHeader (“content-disposition”, String.Format … Read more

Differentiating Between an AJAX Call / Browser Request

If you use Prototype, jQuery, Mootools or YUI you should find a X-Requested-With:XMLHttpRequest header which will do the trick for you. It should be possible to insert whatever header you like with other libraries. At the lowest level, given a XMLHttpRequest or XMLHTTP object, you can set this header with the setRequestHeader method as follows: … Read more

URL Rewrite keeps original host Location when reverse proxy 301 redirects

Could Application Request Routing be involved? Look at IIS -> Machine or Site -> Application Request Routing Cache -> Server Proxy Settings and uncheck the “Reverse rewrite host in response headers” checkbox. If you do this at the machine level, it’ll take effect for all sites. If you do it on a particular site, it’ll … Read more

WCF GZip Compression Request/Response Processing

Thanks for your WCF tip! We’re going to be enabling IIS compression for services at my shop, and I’m hoping your solution will work. By “To make this work for Web Services” – did you mean old school SoapHttpProtocol clients? Because the SoapHttpProtocol class has a built-in EnableDecompression property, which will automatically handle the Compression … Read more

jQuery JSONP ajax, authentication header not being set

I had the same problem recently. Try this: $.ajax({ url: “https://www-opensocial.googleusercontent.com/api/people/@me/@all”, dataType: ‘jsonp’, data: { alt: ‘json-in-script’ }, success: function(data, status) { return console.log(“The returned data”, data); }, beforeSend: function(xhr, settings) { xhr.setRequestHeader(‘Authorization’,’Bearer ‘ + token); } }); EDIT: Looks like it can’t be done with JSONP. Modify HTTP Headers for a JSONP request