0

So I need to create a Curl Script in my PHP and I am confused I don't know that much Curl (As in I only know how to copy and paste and cross my fingers).

The Curl Command is

curl https://website.com/v1/route -u key-of-power

so far I have

                $ch = curl_init();
                curl_setopt ( $ch, CURLOPT_URL, https://website.com/v1/route);
                curl_setopt ( $ch, CURLOPT_POST, 1 );
                curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt ($ch, CURLOPT_TIMEOUT, 30);
                $payment_response = curl_exec ($ch);
                curl_close ($ch);

so I need to know where key-of-power goes so my curl can pass.

Thank in advance!!

1 Answer 1

1

curl_setopt($ch, CURLOPT_USERNAME, "$username") will do it. More detail is here.

Sign up to request clarification or add additional context in comments.

1 Comment

YOU ARE AWESOME thanks, Hate how people blindly down vote -_-

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.