×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    1

    nokia 6600 - a problem with sending data with HTTP POST

    Hej!

    I have a strange problem with sending data (String) from midlet to servlet with HTTP POST. I cannot send more than about 1K of data because phone hung up on flush() method for some time then continue. At the same time servlet's doPost() doesn't obtain any data and throws exception after time out.

    This problem doesn't appear when I use a S60 simulator and it doesn't appear when I send less than 1K of data from N6600.

    a piece of code from the midlet:

    conn = (HttpConnection) Connector.open(URL);

    conn.setRequestMethod(HttpConnection.POST);
    conn.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0"); conn.setRequestProperty("Content-Type", "text/html");
    conn.setRequestProperty("Content-Length", Integer.toString(data.length()));
    conn.setRequestProperty("Connection", "close");

    DataOutputStream os = conn.openDataOutputStream();
    os.writeUTF(data);
    os.flush();
    os.close();

    status = conn.getResponseCode();
    httpResponse = conn.getResponseMessage();

    Maybe there are some size limits of a message, or I should send data in a different form (bytes). Has anybody any suggestions ?

    Ludwik Ejsmont

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    Re: nokia 6600 - a problem with sending data with HTTP POST

    If your web server use chunked request - don`t use flush()... only close()
    getResponseCode will flush.

Similar Threads

  1. Replies: 9
    Last Post: 2010-06-10, 12:39
  2. Nokia 6600 Network (Http and Socket) connections do not work!
    By jimmichr in forum Mobile Java Networking & Messaging & Security
    Replies: 11
    Last Post: 2006-07-14, 07:48
  3. http post problem, series 60
    By tbabben in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2003-10-20, 06:30
  4. Series 60 Concept Emulator (SDK Beta 0.2 Linux) not working
    By mattbee in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-06-10, 11:43
  5. Replies: 1
    Last Post: 2002-08-28, 04:35

Posting Permissions

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