CURL - digest command

Please explain this curl command:

curl --digest \ -u{username}:{password} \ -v \ -X PUT \ -H 'Expect: ' \ -H 'Content-type: application/xml' \ -d @- \ http://webapi.ebayclassifieds.com/webapi/partners/{username}/ads/{ext-reference-id} \ < ad.xml 

What does <Sign mean?

What I understand:

 [--digest] its a digest authentication [-u{username}:{password}] obviously username and password [-X PUT] method="put" [-H 'Expect: '] header = 'Expect: ' [-H 'Content-type: application/xml'] additional header 

This is probably what I am not getting -d @ - url <ad.xml [-d @ - http://webapi.ebayclassifieds.com/webapi/partners/ {username} / ads / {ext-reference- id} <ad.xml]

What I found:

-d, --data p>

(HTTP) Sends the specified data in a POST request to the HTTP server, just as the browser does when the user fills in the HTML code of the form and click the submit button. This will cause the data to swirl to the server using the content type application / x-www-form-urlencoded. Compare with -F, --form.

-d, --data is the same as -data-ascii. To send data in pure binary, you should use the -data-binary option instead. To URL encode the value of a form field you can use --data-urlencode.

If any of these options are used several times with the same line command, the indicated data parts will be combined with the separating & -symbol. So using '-d name = daniel -d skill = lousy' will create a post piece that looks like "name = daniel & skill = lousy".

If you start the data with the letter @, the rest should be a file name for reading data, or - if you want curl to read data from stdin. The contents of the file should already be encoded in the URL. You can also specify multiple files. Posting data from a file named Thus, foobar will be executed using -data @foobar.

Leading question: If someone knows how to translate this to cfhttp, just don’t miss the digest check and assume that the request works with digest authentication.

+6
source share
1 answer

The -d @ - option means that curl will send a POST request with the data it reads from stdin.

"<statement tells the shell to transfer the file to stdin.

You can make a simpler command line, instead do -d @ ad.xml and don't use stdin at all.

+1
source

Source: https://habr.com/ru/post/909292/


All Articles