This may be pretty simple, not entirely sure. Is there a way to take this cURL call below (it's from Big Commerce's API) and rewrite the same function using cfhttp? I know cfhttp acts (or can act like) a form/method="post" type deal, but I'm not sure what params (or what their names should be) to use within a cfhttp tag. Any help would be appreciated...my goal is to be able to use Coldfusion to call a list of products, at which point I can arrange/export to a list/excel/whatever, but setting up the actual call using cfhttp and converting this cURL call is what I'm stuck at.
curl --request GET \
--user-agent "Your Client Name/1.0" \
--header "Authorization: Basic YWRtaW46WW91ckFQSUtleUhlcmU=" \
https://www.example.com/api/v2/products
Should be something along the lines of:
<cfhttp
method="get"
url="https://www.example.com/api/v2/products"
userAgent="Your Client Name/1.0">
<cfhttpparam type="header" value="Authorization: Basic YWRtaW46WW91ckFQSUtleUhlcmU=">
</cfhttp>
This worked for me:
<cfhttp method="post" url="#myUrl#">
<cfhttpparam type="header" name="Authorization" value="Basic YWRtaW46WW91ckFQSUtleUhlcmU" />
</cfhttp>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With