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
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Answers
    102
    Vote Rating
    77
    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,082
    Answers
    24
    Vote Rating
    41
    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
    Teahouse Training Company
    Official Certified Sencha Trainer

    Australia / New Zealand / Singapore / Hong Kong & APAC



    SenchaWorld.com - Sencha webinars, videos, etc
    SenchaForge.org - (coming soon)
    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?