Results 1 to 4 of 4
  1. #1
    atomant is offline Member
    Join Date
    May 2010
    Posts
    45
    Rep Power
    0

    Default Web API using JSON/POST

    I am trying to receive and send data using a website's API. It requires that I post to a URL which returns JSON results and send data using POST.

    How can I do this? And are there any simple examples of doing it? I would like this part to be as easy as possible so I can spend my time doing the rest of it.

    Thanks,
    Adam

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default

    Do you know how to create an http POST in general? i.e. could you do it on paper? If you can do that much, then you could either make the requests/posts by hand using sockets, or you could download something like Apache's HTTPclient library and let it build requests for you.

  3. #3
    atomant is offline Member
    Join Date
    May 2010
    Posts
    45
    Rep Power
    0

    Default

    Is this the Apache HTTP client library? org.apache.http.client

    Do I need to download a .jar file and just import it into my class or what? I couldn't find a jar file to download on that site

  4. #4
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default

    HttpClient - HttpComponents HttpClient Overview
    This is it. You need to download the distro which is a collection of jars, and then add them to your project. In netbeans or eclipse, just add them as external library jars. The documentation and examples come with it!

Similar Threads

  1. Json
    By mac in forum New To Java
    Replies: 10
    Last Post: 06-08-2010, 11:15 PM
  2. JSON Lib: json-lib-1.0-jdk13.jar
    By Raghuraman K in forum Advanced Java
    Replies: 3
    Last Post: 05-13-2010, 10:00 AM
  3. DB Values to JSON
    By prakashkadakol in forum New To Java
    Replies: 1
    Last Post: 01-05-2010, 06:19 PM
  4. Replies: 3
    Last Post: 05-04-2009, 03:15 AM

Posting Permissions

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