curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: -w %{JSON}

From: Коваленко Анатолий Викторович via curl-users <curl-users_at_cool.haxx.se>
Date: Sat, 23 May 2020 22:10:23 +0300

The curl output is not identical JSON, read manual carefully.
I ask how in the curl output to find the right JSON. And must I to find one string or many ones.
Must I check ALL POSSIBLE subsequences of text for JSON formatting? Nonsense.
Read question carefully, please. Do not answer to you own question, answer to my one.

> On 5/22/2020 5:09 PM, Daniel Stenberg via curl-users wrote:

>
> What is the «JSON object» in terms of «MS PowerShell»?
>
>
> I don't understand. How does PowerShell change JSON?
>
>
> There is a string and an array of strings. There are no «JSON objects».
>
>
> A JSON object is text formatted correctly to follow the JSON syntax.
>

>
>
> In recent versions of Powershell you can use ConvertFrom-Json [1] to convert curl's json text output to a custom powershell object.
>
> $var = .\curl -w "%{json}" foo | ConvertFrom-Json
"curl: Saved to filename 'VSCodeSetup-x64-1.45.0.exe'" | ConvertFrom-Json
Ingeniously.
>
> $var.GetType()
>
> $var
>
> [1]:
> https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-5.1
>
>
>

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-05-23