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 3 of 3

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:

  3. #3
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    102
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: HTTP post with json data using java

    Good question: How to set up my host computer and site? Where is your storage RAM located at home or from a larger database? That's okay. I joined this forum twice because I lost my password. But I'm pretty good with handling the browser and C++ programming. Similar to Java methods, but not the same thing.
    Last edited by Helium c2; January 11th, 2024 at 12:58 AM.

Similar Threads

  1. Replies: 4
    Last Post: May 7th, 2014, 11:01 AM
  2. Reg - inserting json data to postgres db.
    By ramya in forum JDBC & Databases
    Replies: 2
    Last Post: August 27th, 2012, 01: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, 12:50 PM
  4. Replies: 2
    Last Post: August 27th, 2012, 12: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, 05:04 AM

Tags for this Thread