w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
difference between request header cache policy and response header
I don't think that Cache-Control is wrong and it seems that your content is already cached. From the request headers, I understand that the first request was done at Tue, 20 Aug 2013 13:08:13 GMT as the browser indicates the server "hey, has the content changed since that time?". In return, the server responses with 304 Not Modified header, indicating that the content has not been changed and it should be cached 604800 seconds more until revalidating it. Remember that the caching is done on server side. So, you may want to look at your server defitinitons on js files. Usually, in the deployment environment, I instruct my webserver to send cache header for *.js *.png etc. After configuring the web server for sending cache headers, it is the browser's work to take care of the rest. In that c

Categories : Http

Jquery Header Selection based on inbuilt CSS class .ui-accordion-header
Found a work around to solve this issue: <script type="text/javascript"> $(document).ready(function () { // on page ready first init of your accordion $('#accordion').accordion( { autoHeight: false, animated: true, collapsible: true, changestart : function(event,ui){ ui.newHeader.attr("disabled",false); }, create: function (event, ui) { $('.ui-accodrion-header').attr("disabled", true); } }); }); </script> This works perfectly... Mentioning this if anyone faces this issue again.

Categories : Jquery

ServiceStack: use attribute in DTO to set response header and response body
A simpler/tidier way to achieve what you want would be to return a HttpResult and define the headers within. public object Get(Todos request) { long count; var items = _repository.GetAll(request.Query, request.Sort, request.IsDesc, request.Limit, request.Offset, out count); var response = items.Select(Mapper.Map<TodoItem, Todo>).ToList(); return new HttpResult(response, HttpStatusCode.OK) { Headers = { {"X-Total-Rows", count} } }; } This avoids polluting your response object with metadata

Categories : Angularjs

How to set response header in spring mvc
public String addUser(@Valid User user, BindingResult bindingResult,HttpServletRequest request,HttpServletResponse response) { if(bindingResult.hasErrors()) { bindingResult.getFieldError(); return"edit"; } response.setHeader("Cache-Control","no-cache,no-store,must-revalidate"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires", 0); return "redirect:/welcome/profile/"+user.getName(); }

Categories : Java

Impossible to have a 304 response when using maxage header
You made a mistake, $response->isNotModified($request) is used only when using cache validation with a ETag or a Last-Modified test! Here, you want to use expiration methods (with Cache-Control or Expires). So just remove theses lines : if ($response->isNotModified($request)) { return $response; } $response->setMaxAge(3600); (and setSharedMaxAge) alone will do the job, you don't need to test anything, the framework (or client navigator) will do it for you. The same response will be served during 3600 second without passing by the action. After 3600 seconds, the user will pass by the action anew and it will be cached for 3600 seconds, etc. In addition, you can use @Cache annotation which simplify the read ;)

Categories : Caching

Response header: Pragma: No-cache
By default Oracle Web Gate uses by default cache control no-cache and pragma no-cache. see the doc here : http://docs.oracle.com/cd/E22203_01/doc.31/e20664/chapter_12.htm at the bottom of the page

Categories : Caching

AngularJS passing Response as header/Web API
I'm not sure you can share data from one service to another service without passing the data as a parameter to a method or constructor. e.g. //inside of a service this.makeAPIcall = function(token){ $http.get('http://...', {headers: {'Authorization': 'Basic ' + token}}); } But you likely want to store the authentication key for future http requests anyway and it would be best to store this key in a way that wouldn't require you to ask for authentication each time you need to make a request. I suggest you store your token in the browser's localstorage or as a cookie so that you can retrieve the token through the term for which the user is logged in. As a side note, if you find that you're going to have to pass the Authorization header each time you make an API call, you may wan

Categories : Angularjs

spring integration: Custom header enricher that records header values to database
This is fairly advanced. You will need a schema, a namespace handler that associates the parser with the namespace element and the parser itself. It might be simpler to use a <transformer/> and simply reference your bean that adds the headers (and stores them). If you want to learn how to write your own namespace; a good place to get started is the STS project templates which will create all of the boiler plate for you. EDIT: In response to your updates... Since it's still a bean definition, and not yet a bean, you can simply change the beanClassName property... BeanDefinition beanDefinition = new StandardHeaderEnricherParser().parse(element, parserContext); beanDefinition.setBeanClassName(Foo.class.getName());

Categories : Spring

How to find header elements in html panel and add event to header to hide p tags?
Change: $("dnn_htmlPan1").find(":header").click(function(){ To: $("#dnn_htmlPan1").find(":header").click(function() { You forgot the # to symbolize you're searching for an ID

Categories : Javascript

jquery accordion close first header on click and open second header, and vice versa
You need to prevent the default event for the accordion $("#myaccordion").accordion({event: false}); See the updated jsFiddle

Categories : HTML

why my echo doesn't work before a header function header(location:home.php);
Actually thy echo is working. but we cant see the message because at the same time the page redirects to the home.php page. If you want to alert to display the alert message use jquery post. or php session variable

Categories : PHP

How Can I Save my Header File in the standard gallery of header files (or whatever it's called)?
Create a library, add the directory of the library and the header file to "path". the header file do not have to have a ".h" extension. This is the vecotr file for stl: #ifndef __SGI_STL_VECTOR #define __SGI_STL_VECTOR #include <stl_range_errors.h> #include <stl_algobase.h> #include <stl_alloc.h> #include <stl_construct.h> #include <stl_uninitialized.h> #include <stl_vector.h> #include <stl_bvector.h> #endif /* __SGI_STL_VECTOR */ you can just create a header file named as "prime" and #include <primes>

Categories : C++

Unix:merge multiple CSV files with same header by keeping the header of the first file
awk 'FNR==1 && NR!=1{next;}{print}' *.csv tested on solaris unix: > cat file1.csv Id,city,name ,location 1,NA,JACK,CA > > cat file2.csv ID,city,name,location 2,NY,JERRY,NY > > nawk 'FNR==1 && NR!=1{next;}{print}' *.csv Id,city,name ,location 1,NA,JACK,CA 2,NY,JERRY,NY >

Categories : Unix

android-async-http library get http response header from Response Handler
@Zapnologica, it seems, that author of library provided changes based on this pull request: https://github.com/loopj/android-async-http/pull/170 But it is not released yet, at least latest available .jar version of library is 1.4.3 and it does not include these changes, unfortunately. The only option we may try to use is cloning/forking git repo and including its sources into your project. UPDATE: Seems library will soon be added to maven central repo, but at least now I was able to add 1.4.4 SNAPSHOT build using gradle for my project with such config changes: repositories { ... //android-async-client repo maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } And then in dependencies section: compile 'com.loopj.android:android-async-http:1.

Categories : Android

ErrorException: Warning: Header may not contain more than a single header, new line detected
You trigger a sanity check of Symfony. When sending headers with header(), theoretically you could send plenty of headers with one function call. Symfony prevents you from accidentally doing it when passing something with a newline character as the target URL.

Categories : PHP

Design dynamic row header, column header and content in MVVM
This is what you want? XAML code: <Grid> <DataGrid Name="SimpleDataGrid" AutoGenerateColumns="True" ItemsSource="{Binding}" /> </Grid> Creating new data row: private void CreateNewDataRow() { // Use the MakeTable function below to create a new table. DataTable table; table = MakeNamesTable(); // Once a table has been created, use the // NewRow to create a DataRow. DataRow row; row = table.NewRow(); // Then add the new row to the collection. row["fName"] = "John"; row["lName"] = "Smith"; table.Rows.Add(row); foreach (DataColumn column in table.Columns) { Console.WriteLine(column.ColumnName); } SimpleDataGrid.DataContext = table; } Creating new columns: private DataTable MakeNamesTable() {

Categories : C#

Make Header View (not Section Header) of ListView Stick on Top
I don't know of any library that lets you do this but what I do for a header is to use a RelativeLayout for my xml that will have the ListView. Then create your header view however you want and give it the property android:layout_alignParentTop="true" then give your ListView android:layout_below="@id/idOfHeaderView This is the easiest way I know of to dock a header view at the top. It has worked for me every time. I hope this helps.

Categories : Android

Extracting from Response Header with Regular Expression
Try this: Location: [S]+?confirmationNumber=(d+) Your issue is the use of special characters in the string without escaping them - e.g.: ? and / Note my ? is not matching the question mark in front of confirmationNumber, but instead is making the [S]+ non-greedy. If you want to be explicit, your version should work if modified like this to escape the characters with special meaning: Location: http://test.regtest.com/cart/confirmation?confirmationNumber=(d+)?

Categories : Regex

modify response header without using xpcom in firefox
You don't need a GUI. There are several ways to get your code running: Create a bootstrapped (restartless) add-on, just like ReDisposition (The GUI parts there are not required) and register from your bootstrap.js. Create an SDK add-on and register from your main.js. Create an XPCOM component and register it for profile-after-change (run at startup, basically) and register once the component gets loaded. Or have a stub overlay, that will just load a JS code module and register in the module. (A little hackish for my taste, but anyway). Anyway, in the end, you'll need to register and observe http-examine-response and friends, no matter what method you use, or what See MDN for more documentation (and the firefox-addon wiki). Other than that, your question is too broad to tell you som

Categories : Javascript

How to create a image when a different header is already set (for a JSON response)
"In that function in order to create the PNG file I need put on the disc I have to declare a new header right?" No. Headers should only be sent to browsers. You don't need to send a header to write to disc.

Categories : PHP

REST Authentication: put key in custom header or Authorization header?
Given your requirements, its sounds like a custom header is the way to go here. I believe your concern regarding it being a poor design choice is irrelevant here because there is no standardized way of passing an API key. API keys mean different things to different applications. To some, its a user id; to others, its a password; and to others still it's simply means of throttling where no explicit authentication is even required. As far as compatibility goes, most tools, allow some flexibility regarding working with API so as long is you don't do anything crazy I think you'll be fine. Whatever you do, just make sure that with any standards you do choose to implement that you implement them fully (OAuth vs "OAuth like") and provide documentation.

Categories : Rest

vim tab header not visible? I am not able to see tab header in vim when opened multiple files using vim -p *.
The 'showtabline' option is what dictates the presence or absence of the tabline. See :help 'showtabline'. Also, may I suggest you to stop using Vim's tabs as proxies for buffers? Tabs are "viewports" or "workspaces": they are not designed at all to work like the tabs you are used to in other programs.

Categories : Vim

How to change tornado post header and add into header new data?
RequestHandler has set_header and add_header methods: http://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.set_header #!/usr/bin/python # -*- coding: utf-8 -*- import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define, options define("port", default=8000, help="run on the given port", type=int) class IndexHandler(tornado.web.RequestHandler): def post(self): data = tornado.escape.json_decode(self.request.body) key = data.get('key', None) # result = fetch_data_for(key) result = "ok " self.add_header('validation', 'value') self.write(result) if __name__ == "__main__": tornado.options.parse_command_line() app = tornado.web.Applic

Categories : Python

MKNetworkKit how to get server response header with session cookie
-_-! Finally, after all that digging around, get the response header like this: -(void)login { NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; [params setObject:@"testusername" forKey:@"username"]; [params setObject:@"abcdef123" forKey:@"password"]; MKNetworkOperation *op = [self.mkEngine operationWithPath:@"/auth/local.json" params:params httpMethod:@"POST"]; [op addCompletionHandler:^(MKNetworkOperation *completedOperation) { NSLog(@"response headers: %@", completedOperation.readonlyResponse.allHeaderFields); } errorHandler:^(MKNetworkOperation *completedOperation, NSError *error) { NSLog(@"Server error: %@", [error localizedDescription]); }]; [self.mkEngine enqueueOperation:op]; }

Categories : IOS

Get Server Date/Time from header.response using jQuery GET
Check how to read headers from AJAX request jQuery and AJAX response header You can just read the date header, but without using a server-side page (aspx, php) the web server will cache files like .txt, .js or .css, and to overwrite that you can pass 'cache' as false to jQuery AJAX so it will append a random query parameter to force the web server to refresh it. Note: You will need empty file(.js, .txt, ..) as the target of AJAX call

Categories : Jquery

In node.js, how do I get the Content-Length header in response to http.get()?
Not every server will send content-length headers. For example: http.get('http://www.google.com', function(res) { console.log(res.headers['content-length']); // undefined }); But if you request SO: http.get('http://stackoverflow.com/', function(res) { console.log(res.headers['content-length']); // 1192916 }); You are correctly pulling that header from the response, google just doesn't send it on their homepage (they use chunked encoding instead).

Categories : Javascript

Http response header not getting modified in firefox extension always
Content-Type is one of the response headers that cannot be modified. The others are Content-Lenght, Content-Encoding, Trailer and Transfer-Encoding. However you can change the inherited contentType attribute of nsIHttpChannel (some restrictions apply).

Categories : Javascript

XMLHttpRequest with Pentaho Data Integration to get the response header
If the URL you're requesting is on a different domain then I can tell you that the server is not sending the correct headers to allow cross-domain resource sharing. Access-Control-Allow-Origin: * Without the server sending that header the only way to access any of the response (including headers) is if your script is running on the same domain (and protocol) or if you setup a proxy on your own server to get the data from the remote server. If I open up the JS console on this page and run: var req = new XMLHttpRequest(); req.open('GET', 'http://dati.toscana.it/it/storage/f/2012-07-26T160139/intoscana-arte-e-cultura.csv', false); req.send(null); console.log(req.getAllResponseHeaders()); I get the following output: XMLHttpRequest cannot load http://dati.toscana.it/it/storage/f/2012-07

Categories : Http

Setting WWW-Authenticate response header within a DelegatingHandler causes havoc on w2k3
You need to install .net Framework 4.0.3. Prior versions of .net framework could not set the www-authenticate header. Get it here, more info on the issue is in KB2600211.

Categories : Dotnet

how to clear cache of response header if the content(image) changed in asp.net
You don't. Once it's cached, it's cached. And that's exactly why I don't like caching. What you can do is add a parameter to the url, like http://www.whatever.com/images/myfile.jpg?no_cache=lastWriteTimeUTC

Categories : Javascript

How does a browser interpret a page with no charset in the response header or meta tag?
If no charset is found then it will read some amount of the HTML code from the page and then try to guess the encoding. If it cannot figure it out then it will default to the browser's default character set. Depending on the browser it will often be something like Windows-1252 (a superset of Latin-1 also called ISO 8859-1) or UTF-8. It is important that you set the character set yourself. There are vulnerabilities (at least in older versions of IE) where you can feed the browser malicious code that will run if the browser guesses wrongly or uses its default charset. Setting it in an HTTP header should always be done, and setting it in the HTML never hurts. Setting it as a header is usually done by the server. In Apache it is usually done in the httpd.conf file, but it can also be done i

Categories : HTML

Can A Header Be Added & Body Modified In A Salesforce SOAP Response?
I don't believe you can directly add any kind SOAP headers in an Apex defined WebService methods. If you have absolutely no other option you could construct your own custom SOAP response via a REST web service (via @RestResource annotation) but that is a pretty ugly solution.

Categories : Web Services

Reference a private header from a public header
Public headers must not import private headers. There should be nothing in your public header that relies on private data structures. If the caller has to know about the private data structure, then it's not private. If the caller doesn't need to know about the private data structure, there's no reason to include it in the public header. You'd have to give more details about your particular header (what parts of AFHTTPClient are in JPImgrClient?) That said, you should not privately include a common library like AFNetworking. There may be other frameworks that require it (including the main program). If you include it privately then there will be collisions which will be very challenging for the end developer to resolve. You need to let your users know that they need to include AFNetworkin

Categories : Objective C

freeze table header with css first rows are under header
You've set thead{position:fixed}. I've never actually used position:fixed on a table header like that, but I assume it's pinning it to the top of the frame like you want. The problem is that fixed-position elements don't take up any space on the page - stuff slides right in underneath them. You should be able to compensate for this by adding a margin-top to your tbody, or, if that doesn't work, to table tr:first-child. If that doesn't work either, I'd just stick an appropriately-sized empty tr at the top and be done with it. Edit: Actually, playing around with your fiddle, it doesn't look like the fixed-position table header is correctly setting the widths of your rows on my browser. What browser are you using? This appears to be the type of unconventional CSS that can cause cross-browse

Categories : HTML

Using header(), does the header get sent instantly, or after the full script has run?
You can explicitly send the header by calling flush() immediately after your header() call, otherwise I believe no headers are sent until the output buffer is flushed, or your script finishes - whichever comes first.

Categories : PHP

Allow the main header to be underlined when the sub header is clicked
EDIT Use this selector instead, no need for extra classes $(this).closest('.desktopNavBar > li').find('a:first').addClass('current'); Demo fiddle Also make sure you validate your HTML markup because there are some errors in what you posted, for example some li tags are not closed

Categories : Jquery

How to use a function from a header file without including the header in C?
But this would fail for most of the cases where the header has been pre-compiled into object files This sentence makes no sense. A header can be used to compile an object file, but they never get compiled into object files; they are always used externally.

Categories : C

Can't get Java's GZIPInputStream to read "gzip" response from server when using "Range" header
You can use 'gunzip' to decompress it, just keep in mind that the first 50 bytes probably aren't enough for gzip to decompress anything (headers, dictionaries etc). Try this: wget -O- -q <URL> | head -c 50 | zcat with your URL to see whether normal gzip works where your code fails.

Categories : Java

How do I clone custom HTTP Request Header Variables to the Response in IIS6?
MSDN has a good write up on working with HTTP header variables in IIS6. HOWTO: Retrieve Request Headers using ISAPI, ASP, and ASP.Net

Categories : Http

How to select a TabItem based off of it's Header
Firstly, you have to get the parent node and the number contained in its header: TreeViewItem parentItem = (TreeViewItem)selectedItem.Parent; int curNumber = getNumber(parentItem.Header.ToString()); getNumber is a function to retrieve the number from its exact location in the parent node header. You have to tell more about that in order to write a proper function; for the time being, just the basics (it extracts all the numbers in the input string): private int getNumber(string parentNodeHeader) { int curNumber = 0; //Required string-analysis actions //Sample functionality: extract all the numbers in the given string string outString = ""; int count = -1; do { count = count + 1; Char curChar = Convert.ToChar(parentNodeHeader.Substring(count,

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.