I am writing in PHP and using curl.
I am copying the API key from the rapidapi website.
I am setting the headers in curl:
curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt(curl, CURLOPT_SSLVERSION, 6);
curl_setopt($curl, CURLOPT_URL, $Url);
curl_setopt($curl, CURLOPT_HEADER, curl, CURLOPT_POSTFIELDS, http_build_query(curl, CURLOPT_POST, 1);
where $headers =
Array
(
[content-type] => application/json
[X-RapidAPI-Host] => sales-tax-calculator.p.rapidapi.com
[X-RapidAPI-Key] => XXX-value-I-copied-XXX
)
the URL = https://sales-tax-calculator.p.rapidapi.com/rates;
I have also tried setting CURLOPT_HTTPHEADER instead of CURLOPT_HEADER.
any thoughts on what I am doing wrong?
Thanks,
Joel
加入讨论 - 在下面添加评论:
Thanks for the speedy reply.
The sample worked, my curl structures needed some help. So all fixed. Thank you.
A couple of questions:
I did not see the PHP example on the website. Am I missing something?
How often is your tax database updated?
How can I figure out regional exceptions for certain tax free merchandise - (clothing is tax free in certain places etc). any thoughts on how to handle this if you don’t
Thanks again,
Joel
Hello! Thanks for the inquiry! It’s a little tough to debug where this may be failing with the markup issues in the message. Have you tried the sample PHP code and edit as needed for your input?
I see the message board munged some of the curl_setopt underbars into various letters. in my source it looks right and works fine in other curl conversations.
Joel