Home > Back-end >  Generate json file using curl xml
Generate json file using curl xml

Time:06-30

I'm trying to generate json file using curl and also assign specific path where in the json file will store once generated, but I tried some commands but no json output.

May I know what I need to add or change with my command?

curl -v -H "Accept: application/json" --user "admin:Test1234" https://test.com/adventure/ 

CodePudding user response:

I test a simple curl for a json public api and send de response to a file and the result is a JSON output.

curl -H "Accept: application/json" https://catfact.ninja/fact >> cat.json

You can try it using https://reqbin.com/req/javascript/c-vdhoummp/curl-get-json-example

Or simply using postman and see the code snippet option to check cUrl code snippet. https://imgur.com/a/LXqN8YH

CodePudding user response:

I'm able to generate json file I add -k on my command since my url is https. Thank you for your inputs. I really appreciate it.

  • Related