×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    19

    HttpConnection in Nokia 7650

    can nokia 7650 HttpConnection API use???
    i has exception in openInputStream.

    my code
    -----------------------------------------------
    System.out.println("debug0 " + url);
    conn = (HttpConnection)Connector.open(url);
    System.out.println("debug1"
    // Set the request method and headers
    conn.setRequestMethod(HttpConnection.POST);
    System.out.println("debug2"
    conn.setRequestProperty("Content-Length",
    Integer.toString(request.length()));
    System.out.println("debug3"
    // Getting the output stream may flush the headers
    out = conn.openOutputStream();
    System.out.println("debug4"
    int requestLength = request.length();
    System.out.println("debug5"
    for (int i = 0; i < requestLength; ++i)
    {
    System.out.println("debug6"
    out.write(request.charAt(i));
    }

    // Opening the InputStream will open the connection
    // and read the HTTP headers. They are stored until
    // requested.
    System.out.println("debug7"
    in = conn.openInputStream();
    System.out.println("debug8"
    ------------------------------------------------


    code result print
    --------------------------------------------------
    Nokia Series 60 MIDP SDK Beta 0.1 <default>: debug0 http://www.feelmobile.net/feelmobile/servlet/SumServlet

    Nokia Series 60 MIDP SDK Beta 0.1 <default>: debug1

    Nokia Series 60 MIDP SDK Beta 0.1 <default>: debug2

    Nokia Series 60 MIDP SDK Beta 0.1 <default>: debug3

    --------------------------------------------------

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    101

    RE: HttpConnection in Nokia 7650

    To avoid a bug in the MIDP implementation, you need to call out.close() before you open the input stream.

Posting Permissions

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