1. #1
    Sencha User
    Join Date
    Dec 2013
    Location
    Taguig City, Philippines
    Posts
    2
    Vote Rating
    0
    marc.dejoya021 is on a distinguished road

      0  

    Default Unanswered: Send long data using JSONP?

    I want to send long text and save it in a database hosted online.
    But I'm getting a
    414 (Request-URI Too Large)

    Im stucked right now and cant find any solution.

    As I know, JSON sends data through GET method. I was wondering if I can change it to POST method. Is it possible?

    This is my code:

    Ext.util.JSONP.request({
    url: 'http://hostname.com/folder/myfile.php?action=add',
    callbackKey: 'callback',
    params: data,
    method: 'POST',
    success: function(response) {
    // do something
    },
    failure: function(response) {
    // do something

    }
    });

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    84
    Answers
    102
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default

    No. JSONP uses script tags, which uses HTTP GET, which is why you have the limitation.

    You can use XHR2 (most modern browsers though).

  3. #3
    Sencha User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    Answers
    25
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default

    use a standard cross domain form post and do some research on CORS
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  4. #4
    Sencha User
    Join Date
    Dec 2013
    Location
    Taguig City, Philippines
    Posts
    2
    Vote Rating
    0
    marc.dejoya021 is on a distinguished road

      0  

    Default

    How can I do this sir? Can you give a sample code?