vefpanel.blogg.se

Curl json helper
Curl json helper




curl json helper

So I'm pushing back at answers that are of the form "do it in the usual way" because I don't know what that "usual way" is. That was a hard glitch to debug because it was hard to determine where, among several levels, the error was actually occurring and I'm pretty new at all this. How can i provide the correct code to curl or uri module Ps.

#Curl json helper how to#

But I'm looking for more specifics about how to actually construct the curl command.įor instance, the sample commands on the API Introduction page that we both cited have constructions like this: curl ''īut when I inserted $MyKey and $MyToken values into that string, I got an error from the shell because the single quotes had to be changed to double quotes so that the variables will be expanded to their values. Your answer is, briefly, yes, that ought to work. I believe that I have to add this to the curl options to have it properly upload JSON data: -header "Content-Type: application/json" What I'm interested in is being able to have a more complex creation command read from a file or from a shell variable that is in JSON format. The idList, name, and pos data are all provided on the curl command line and the response is piped through jq to display only the name and pos of the created card, as confirmation. In the above $WhoMe contains my token and key. HTTP offers many different methods of authentication and curl supports several: Basic, Digest, NTLM and Negotiate (SPNEGO). So far, in my shell script, I have a construction like this: curl -s \ That's the page I linked to in my question.






Curl json helper