-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding a new topic related to GuzzleHttp library #6859
Conversation
An admin must run tests on this PR before it can be merged. |
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.
Hi @eduard13. Thank you for your contribution. Please, check my comments below for some minor adjustments.
Also, it would be awesome to add some information about why exactly Guzzle is better/preferable than the built-in cURL wrapper and in what cases.
Thank you!
contributor_link: https://www.atwix.com/ | ||
--- | ||
|
||
This tutorial shows you how to create an integration with an external API using [GuzzleHttp](http://docs.guzzlephp.org/en/stable/quickstart.html){:target="_blank"} library, that is included into magento package. |
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.
This tutorial shows you how to create an integration with an external API using [GuzzleHttp](http://docs.guzzlephp.org/en/stable/quickstart.html){:target="_blank"} library, that is included into magento package. | |
This tutorial shows you how to create an integration with an external API using [GuzzleHttp](http://docs.guzzlephp.org/en/stable/quickstart.html){:target="_blank"} library, that is included into Magento package. |
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.
👍
|
||
## Create a Github API integration | ||
|
||
In the following example, we're be using the [Github API](https://api.github.com/) as web service, and will fetch some data regarding the Magento 2 Git repository. |
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 the following example, we're be using the [Github API](https://api.github.com/) as web service, and will fetch some data regarding the Magento 2 Git repository. | |
In the following example, we're using the [Github API](https://api.github.com/) as web service, and will fetch some data regarding the Magento 2 Git repository. |
/** | ||
* Fetch some data from API | ||
*/ | ||
public function execute() |
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.
Since we use strict types, it makes sense to define all return types
public function execute() | |
public function execute(): void |
Also, please, add another "Whatsnew" section to the PR description with a few sentences about what new info has been added in your PR. |
Hi @rogyar, thank you for your suggestions, the topic has been slightly improved. Could you review the last changes, please? |
Could you doublecheck the "whatsnew" section, please? I'm not sure we are adding info about
within the scope of the current PR. Also, the link in the "whatsnew" section does not work. Thank you. |
I've just updated the section, regarding the url, I was thinking that we need to provide the url of the new topic (as I've seen on some related PRs). |
Here is another example of a class that uses Guzzle client from the codebase |
running tests |
Hi @eduard13, thank you for your contribution! |
Hi @dobooth, is there any reason of rewarding this PR only as improvement? |
Purpose of this pull request
This pull request (PR) adds a new page where it is described how can we easily integrate an API web service in Magento. It's a good replacement of directly using CURL library.
Affected DevDocs pages
N/A
Links to Magento source code
whatsnew
Added a new topic about how to create an integration using the GuzzleHttp external API to use some external Web Services.