Results 1 to 4 of 4

Thread: ExtJs AJAX and defaultheaders.

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    103

    Default ExtJs AJAX and defaultheaders.

    Below is my ajax call -
    Code:
    Ext.Ajax.request(//Ext.apply(this.createCallback(o), 
                		{
                	url : 'getdata.php',
                    //method: 'GET',
                	defaultHeaders: {'Content-Type': 'text/xml;charset=UTF-8'},
                    params:xmlData, //add our values
                    success: function(result, request) {
                			
                		},
                        failure: function ( result, request) { 
                			al
                        } 
                });
    Seems like the default headers aren't getting set. I can see in webscarab that default heder is nt the form i had entered. don't know what to do. My Spring service is set to accept any type of header, but seems like the xml data posted along with this request gets encoded and the server cannot figure out how to decode and map to the object.

  2. #2

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Works for me. From Firebug when I execute that code snippet (with xmlData set to {}):

    Code:
    Host	localhost:8080
    User-Agent	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729)
    Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language	en-gb,en;q=0.5
    Accept-Encoding	gzip,deflate
    Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive	115
    Connection	keep-alive
    Content-Type	text/xml;charset=UTF-8
    X-Requested-With	XMLHttpRequest

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    But sending params will not send XML. So your header will be untruthful.

Similar Threads

  1. ExtJS and Reverse AJAX (AJAX Push or Comet)
    By rvillane in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 15 Oct 2008, 11:55 AM
  2. [2.0.1] Unable to override Ext.Ajax.defaultHeaders
    By patspam in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 7 Feb 2008, 4:05 PM
  3. How to set defaultHeaders for ScriptTagProxy
    By anicola in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 30 Oct 2007, 1:09 AM
  4. How to define defaultHeaders in data.Connection?
    By royi in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 21 Sep 2007, 12:19 AM
  5. defaultheaders + extraparams
    By johnr in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 14 Jun 2007, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •