Skip to content

Instantly share code, notes, and snippets.

@jaredkrinke
Created April 15, 2025 22:53
Show Gist options
  • Select an option

  • Save jaredkrinke/64349d3b5dd87476cc9cde84b35eefb8 to your computer and use it in GitHub Desktop.

Select an option

Save jaredkrinke/64349d3b5dd87476cc9cde84b35eefb8 to your computer and use it in GitHub Desktop.
Validate an Atom feed using W3C validator using curl
curl -X POST --data-urlencode rawdata=$(< test.xml) --data-urlencode manual=1 https://validator.w3.org/feed/check.cgi

Annoyingly, I couldn't find a way to have curl do a "dry run" (show me the request without sending it). Someone else had this issue and netcat was suggested (and worked for my purposes): https://stackoverflow.com/questions/6180162/echo-curl-request-header-body-without-sending-it

Additionally, I couldn't find a way to URL-encode a file using curl's CLI, so I had to resort to shell magic. Again, someone else already asked about this and a workaround was suggested: https://unix.stackexchange.com/questions/270457/how-can-i-give-an-argument-as-an-external-file-to-curl-with-url-encode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment