Skip to content

Commit a26b023

Browse files
author
Martin Brecht-Precht
committed
Request now invokes the Authentication methods.
1 parent 20bd508 commit a26b023

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Diff for: src/Request/AbstractRequest.php

+3-16
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,6 @@ public function configureCurl($curl)
301301
curl_setopt($curl, CURLOPT_HTTPGET, false);
302302
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->getMethod());
303303
}
304-
// Request body
305-
switch ($this->getMethod()) {
306-
case self::REQUEST_METHOD_GET:
307-
case self::REQUEST_METHOD_HEAD:
308-
// Modify the URL using the body as query string
309-
break;
310-
case self::REQUEST_METHOD_POST:
311-
// curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
312-
break;
313-
case self::REQUEST_METHOD_PUT:
314-
// curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
315-
break;
316-
case self::REQUEST_METHOD_PATCH:
317-
// curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
318-
break;
319-
}
320304
return $this;
321305
}
322306

@@ -337,6 +321,9 @@ public function perform()
337321
$this->configureCurl($curl);
338322
$this->getTransport()->configureCurl($curl);
339323
$this->getMessage()->configureCurl($curl);
324+
for ($i = 0; $i < count($this->authentications); $i++) {
325+
$this->authentications[$i]->configureCurl($curl);
326+
}
340327
// Execute request
341328
$responseBody = curl_exec($curl);
342329
$curlErrorCode = curl_errno($curl);

0 commit comments

Comments
 (0)