Rest API call in java

I can do the Rasa Rest API call in python by below code.

inp = str(input())
url = 'http://localhost:5005/model/parse'
data = {'text': inp}

response = requests.post(url, json=data)
response = json.loads(response.text) 

How can we write the equivalent code in java? Thanks in advance.

I don’t understand your problem correctly, but If you just wanna know how to make api calls in java, this stackoverflow link could be of interest to you.