Reputation: 89
I want to have an array with the value of json:
arr[ ] array = {"http://www.ip-api.com/json"};
when I print this array, how can I have json but not "http://www.ip-api.com/json" as a string?
Upvotes: 0
Views: 59
Reputation: 41168
Use a JSON generating library such as Jackson and have it serialize the data structure.
https://github.com/FasterXML/jackson
If you want to actually mean that you want to call the service at that URL then you need to use a suitable library for that...
Upvotes: 1