Sorry, I guess including the code would help. And actually I deleted the code last night and rewrote it from the ground up, so now it works. Here is the working code:
<?php
$handle = fopen("courses.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$URL = "https://somecollege.instructure.com:443/api/v1/courses/".$data[0]."?course%5Bimage_url%5D=https://somesite.edu/media/images/canvas/".$data[3].".png";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $URL,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer HaHaYouThoughtIWouldIncludeThis'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
}
?>