-3

i have a url that inide of this url is json code . i need this content to decode. for example if my url is : http://url.com i have this json in it:

{ "employee":{"mesg":"username is exsist!","id":0,"name":0,"username":0,"email":0,"status":500} }

i need from url.com this data to put in a variable and decode this. for decoding i dont have problem . just i need to get data from url , like file_get_contents in php . , thanks

NOTICE:

i use HttpClient for this solution . but it is deprecated . is another way for this?

persian
  • 41
  • 5

1 Answers1

0

You can use IOUtils.toString(url) from Apache Commons library.

Andrew
  • 434
  • 1
  • 5
  • 13