javapostpostmanhttprequesthttpentity

I need to perform Basic authentication as well as send key value as body for a Http Post request and get data


Basic Authorization for url

Key value content in body x-www-form-urlencoded

I need to perform both basic auth and pass www-form-urlencoded data in the body. How can i code in java using http to get response data obtained after passing above data to the url.


Solution

  • postman helps you create code snippet from itself you can use that also:

    enter image description here

    Now use the code you want :

    enter image description here