×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    80

    Http get and post example in J2me

    Hi,
    Can anybody provide me complete and working example of simple http get and post example. From net I tried several but could not make any one working.
    You can provide link so that I can download it

    Thanks

    br,

    A J

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Http get and post example in J2me

    Take look in the JavaDocs for the HttpConnection interface.. you'll find these in the docs folder of the SDK.

    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    376

    Re: Http get and post example in J2me

    Try simply searching in DIBO
    the simple form with as GET/POST can be used to send data to application
    while the server side code has been given below



    Code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    
    /** Simple servlet that reads three parameters from the form data.
    * Part of tutorial on servlets and JSP that appears at
    * http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
    * 1999 Marty Hall; may be freely used or adapted.
    */
    
    public class ThreeParams extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    /// title ="";
    out.println(
    // title
    request.getParameter("param1")
    + request.getParameter("param2")
    +request.getParameter("param3") );
    }
    
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doGet(request, response);
    }
    }

  4. #4
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

Similar Threads

  1. Http post data and get response
    By amit.mangal in forum Symbian
    Replies: 14
    Last Post: 2009-10-03, 15:28
  2. HTTP GET and POST METHOD
    By hornsattack in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2009-08-03, 11:26
  3. HTTP GET and POST
    By andrzej.grzes in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-07-24, 10:56
  4. retrieve phone book code example and post to http (GPRS)
    By supanana in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-13, 07:13

Posting Permissions

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