The T3Connector class is designed to facilitate making HTTP requests to an API. It encapsulates the functionality needed to build and execute these requests in a fluent and flexible manner.
- TYPO3 v11 >=
- friendsoftypo3/headless
importT3Connectorfrom"@su14iman/typo3-connector";
constconnector=newT3Connector(`https://headless-typo3.typo3.su14iman.local`);
connector.query({
path:"/"
})
.method("GET")
.cached()
.fetch<T3ContentElements[]>()
.then((res)=>{
console.log(res['id']);
});
to start new query and clear old path and old uri
- @returnT3Connector
to set cache in fetch options
- @returnT3Connector
to set method - GET | POST | PUT | DELETE
- @returnT3Connector
to set data in fetch options
- @paramObjectdata
- @returnT3Connector
to parse request,but you do not need to add it to the query, it was added to be used with tests
- @returnT3Connector
to fetch data from API
- @returnT3Connector
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -am 'Add your feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a new Pull Request
This project is licensed under theMIT License.