1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    220
    Answers
    13
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default Answered: JSON in ajax request

    Answered: JSON in ajax request


    How to send an ajax request with content type json.

    Using Ext Direct proxy on a store/model then doing store.load
    sends JSON to the server, the request content type is application/json
    Code:
    Request Headers :
        Content-Type:application/json
         Request Payload
        {"action":"acrQuery","method":"Select","data":[{"page":1,"start":0,"limit":25}],"type":"rpc","tid":4}
    how can i archive the same content type using Ext ajax ?
    if i use Ext.Ajax (using the same data params above) sends
    Code:
    Request Headers :
       Content-Type:application/x-www-form-urlencoded; charset=UTF-8
       Form Dataview URL encoded
       {"action":"acrQuery","method":"Select","data":[{"page":1,"start":0,"limit":25}],"type":"rpc","tid":4}
    its using an html form to send the params, which is correct because documentation says so
    but i need to send a request as json (application/json) so i can proceed like i normally do when a store/model sends a request.

    so how can i make an ajax request that will use content-type:application/json not a form? like my stores load do.

  2. Try this:
    Code:
    Ext.Ajax.request({
        ....
        headers: {
            'Content-Type': 'application/json',
            ...
        }
        ....
    });

  3. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      1  

    Default


    Try this:
    Code:
    Ext.Ajax.request({
        ....
        headers: {
            'Content-Type': 'application/json',
            ...
        }
        ....
    });

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    220
    Answers
    13
    Vote Rating
    9
    dedoz will become famous soon enough

      0  

    Default


    thanks

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi