Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: HTTP post with json data using java

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question HTTP post with json data using java

    How to send json data to REST Api using java.

    we need to open a url connection for that API with username and password that has been provided by them.

    I have username , password connection type i.e basic authentication.

    So anyone pl help me to create HTTP client to post the json data to particular API.


  2. #2
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: HTTP post with json data using java

    You can quite easily find out how to do this by making a few Internet searches. E.g.,

    Search term: java http client json

    Example result:

    Apache HttpClient and Jersey are but just 2 of the many ways this can be done.

    Apache HttpClient is quite convenient because it can also handle basic authentication.

    Search term: httpclient basic authentication

    Example result:

Similar Threads

  1. Replies: 4
    Last Post: May 7th, 2014, 12:01 PM
  2. Reg - inserting json data to postgres db.
    By ramya in forum JDBC & Databases
    Replies: 2
    Last Post: August 27th, 2012, 02:34 PM
  3. Reg - inserting json data to postgres db using java
    By ramya in forum JDBC & Databases
    Replies: 2
    Last Post: August 27th, 2012, 01:50 PM
  4. Replies: 2
    Last Post: August 27th, 2012, 01:42 PM
  5. Can't form a simple POST or GET http request. No data returns.
    By goodguy in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 29th, 2011, 06:04 AM

Tags for this Thread