Example Curl POST request for XML document from CakePHP

Written by James McDonald

June 25, 2018

This is an example of using the curl command to request a CakePHP URL and post form data to it. It uses xmllint to format the output and highlight (under MacOS) to colorize the output

#!/bin/sh
# save as curlIt.sh
curl -s \
-d "data[Label][start_date][day]=25&data[Label][start_date][month]=06&data[Label][start_date][year]=2018" \
-H "Accept: text/xml" http://servername/path/to/CakePHP/Form |\
xmllint --format - |\
highlight --syntax=xml --out-format=ansi

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...