×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    38

    Smile http post request via socket connection

    does anyone know how to implement htt post request through socket connection?
    some sample codes would be very helpful. thanks!

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: http post request via socket connection

    It's possible, but it's not easy.

    The first problem is that your HTTP server should accept the socket connections on port 80, 8080, or any else specified. There are also some port redirectors available, but such architecture is for the case when your server is not already running tones of applications on the HTTP.

    The second problem is that your mobile application will have to implement all the HTTP POST composing functionalities (and HTTP response decoding too). That's not an easy thing. For the minor HTTP protocol implementation (on the client's side) take a look at this document, HTTP Made Really Easy: http://www.jmarshall.com/easy/http/

    Technically speacking, almost all the network communications are based on sockets, but the protocol handling and implementation is a heavy thing. I would rather recommend you to use the standard techniques, protocols and components, but that's just my IMHO.

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    38

    Re: http post request via socket connection

    thanks for that info...
    im looking for other alternatives in sending images to my webserver..
    http connection is not working for me..

    can you suggest other methods?

  4. #4
    Regular Contributor
    Join Date
    Aug 2006
    Posts
    307

    Re: http post request via socket connection

    Well, if you'll run a server which accepts the socket connections, then there are no need to implement HTTP POST in order to upload an image. You are free to implement your own data protocols to send data.

    For example, you can send over the socket connection the size of image (as integer), it's name or user's ID, and the image data itself. All one by one, in the same stream. For this no HTTP-POST functionality is required.

    The same way the Bluetooth-based image exchangers are working: they utily socket connections and implement their own data protocols.

    Take a look at these documents and threads, probably you'll find something interesting.

    Advanced MIDP Networking, Accessing Using Sockets and RMI from MIDP-enabled Devices: http://developers.sun.com/mobility/m...RMI/index.html

    J2ME Low-Level Network Programming with MIDP 2.0: http://developers.sun.com/mobility/m...ork/index.html

    Transfer images between phones: http://discussion.forum.nokia.com/fo...d.php?t=108748

Similar Threads

  1. Problems with http - POST
    By bigbadwolf in forum Symbian Networking & Messaging (Closed)
    Replies: 13
    Last Post: 2007-01-17, 23:45
  2. Problem with HTTP POST
    By thathoo in forum Mobile Java General
    Replies: 2
    Last Post: 2006-12-18, 18:23
  3. Socket http get request
    By alokkumarsingh in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-06-08, 16:00
  4. Socket connect, then HTTP POST
    By kkramhoeft in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2003-05-30, 06:15
  5. Replies: 0
    Last Post: 2003-03-10, 03:46

Posting Permissions

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