-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing REST methods to Curl Client (SwiftOtter's SOP-348) #39330
base: 2.4-develop
Are you sure you want to change the base?
Changes from 5 commits
302f9b5
e3668e8
064aa04
0ec2621
2da6f81
d16233e
4297a88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
/** | ||
* Class to work with HTTP protocol using curl library | ||
* | ||
* @author Magento Core Team <[email protected]> | ||
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity) | ||
* @api | ||
*/ | ||
|
@@ -246,6 +245,74 @@ public function post($uri, $params) | |
$this->makeRequest("POST", $uri, $params); | ||
} | ||
|
||
/** | ||
* Make PUT request | ||
* | ||
* @param string $uri | ||
* @param array|string $params | ||
* @return void | ||
*/ | ||
public function put($uri, $params) | ||
{ | ||
$this->makeRequest("PUT", $uri, $params); | ||
} | ||
|
||
/** | ||
* Make DELETE request | ||
* | ||
* @param string $uri | ||
* @return void | ||
*/ | ||
public function delete($uri) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to HTTP documentation, DELETE request can include optional payload. |
||
{ | ||
$this->makeRequest("DELETE", $uri); | ||
} | ||
|
||
/** | ||
* Make PATCH request | ||
* | ||
* @param string $uri | ||
* @param array|string $params | ||
* @return void | ||
*/ | ||
public function patch($uri, $params) | ||
{ | ||
$this->makeRequest("PATCH", $uri, $params); | ||
} | ||
|
||
/** | ||
* Make OPTIONS request | ||
* | ||
* @param string $uri | ||
* @return void | ||
*/ | ||
public function options($uri) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to HTTP documentation, OPTIONS request can include optional payload. |
||
{ | ||
$this->makeRequest("OPTIONS", $uri); | ||
} | ||
|
||
/** | ||
* Make HEAD request | ||
* | ||
* @param string $uri | ||
* @return void | ||
*/ | ||
public function head($uri) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to HTTP documentation, HEAD request can include optional payload. |
||
{ | ||
$this->makeRequest("HEAD", $uri); | ||
} | ||
|
||
/** | ||
* Make TRACE request | ||
* | ||
* @param string $uri | ||
* @return void | ||
*/ | ||
public function trace($uri) | ||
{ | ||
$this->makeRequest("TRACE", $uri); | ||
} | ||
|
||
/** | ||
* Get response headers | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line no. 53:
I suggest you add the parameter
$curl
asnull
and useObjectManager
to initialize it. Please refer to the$this->deploymentConfig