0

What is the best way to save a large JSON from a REST API call to a text file? I currently use Postman in Chrome to test the API and sometimes it makes Chrome un-responsive due large JSON output. I would like to write some Java codes to save the large JSON to a text file. Is there a way to stream the REST output straight to text input stream so that it wouldn't take too much memory at run time?

Bolto Cavolta
  • 413
  • 1
  • 8
  • 16

1 Answers1

1

Suggest that you use cURL.

An example usage is found here : Capture Curl Output to a File

It should be more efficient than buffering the entire output.

Community
  • 1
  • 1
cmonkey
  • 4,256
  • 1
  • 26
  • 46