Re: -w %{JSON}
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