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?

    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 - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    82
    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 Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,089
    Vote Rating
    54
    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
    Teahouse Training Company

    Comprehensive Javascript, Sencha and 3rd Party Stack Training available worldwide online, and onsite in APAC, written by certified official Sencha trainers.



    Unofficial Sites:

    SenchaWorld.com - Videos, and stuff
    Sencha.Community - Tools, Extensions and Resources
    TeahouseHQ.com - Sencha Ecosystem Training Portal

    Code Validation : JSLint | JSONLint | JSONPLint

  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?