My curl call doesn’t complete - it gets ends up showing the end of the JSON response and you have to press [enter] to get the final 2 lines (e.g. [1]- Done ...
) to print to shell. And > report.json
isn’t capturing the response as the resulting file is empty. Call and response below, with JSON removed for sake of space (but it is a correct response). I just want curl to report the json to file and end without having to press enter. I’m not massively experienced with REST so I’m probably missing something.
Me-MBPX:apps mycomputer$ curl -uMY_API_KEY: https://api.companieshouse.gov.uk/search?q=trump&items_per_page=10&start_index=1 > report.json
[1] 7211
[2] 7212
Me-MBPX:apps mycomputer$ {"kind":"search#all","total_results":569,"items_per_page":20,"start_index":0,"items":[{"links":{...CORRECT_JSON...}
[1]- Done curl -uMY_API_KEY: https://api.companieshouse.gov.uk/search?q=trump
[2]+ Done items_per_page=10
I’ve tried with a number of additional arguments, e.g. various combinations of following: -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET
. Nothing works. Grateful for assistance.