Skip to content

Commit 2732eff

Browse files
committed
first commit
0 parents  commit 2732eff

25 files changed

Lines changed: 1412 additions & 0 deletions

.idea/php.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/CaioLandgraf/uploader).
6+
7+
## Pull Requests
8+
9+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
10+
- **Document any change in behaviour** - Make sure the README and any other relevant documentation are kept up-to-date.
11+
- **Create topic branches** - Don't ask us to pull from your master branch.
12+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
13+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
14+
15+
**Happy Coffee**!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2010 Caio Landgraf
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# RequestApi Library Test
2+
3+
[![Maintainer](http://img.shields.io/badge/maintainer-@caiolandgraf-blue.svg?style=flat-square)](https://twitter.com/caiolandgraf)
4+
[![Source Code](http://img.shields.io/badge/source-caiolandgraf/requestapi-blue.svg?style=flat-square)](https://github.com/caiolandgraf/requestapi)
5+
[![PHP from Packagist](https://img.shields.io/packagist/php-v/caiolandgraf/requestapi.svg?style=flat-square)](https://packagist.org/packages/caiolandgraf/requestapi)
6+
[![Latest Version](https://img.shields.io/github/release/caiolandgraf/requestapi.svg?style=flat-square)](https://github.com/caiolandgraf/requestapi/releases)
7+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
8+
[![Build](https://img.shields.io/scrutinizer/build/g/caiolandgraf/requestapi.svg?style=flat-square)](https://scrutinizer-ci.com/g/caiolandgraf/requestapi)
9+
[![Quality Score](https://img.shields.io/scrutinizer/g/caiolandgraf/requestapi.svg?style=flat-square)](https://scrutinizer-ci.com/g/caiolandgraf/requestapi)
10+
[![Total Downloads](https://img.shields.io/packagist/dt/caiolandgraf/requestapi.svg?style=flat-square)](https://packagist.org/packages/caiolandgraf/requestapi)
11+
12+
###### RequestApi Library is a small set of classes developed by Suporte Informátika to facilitate communication with API's and third-party forms...
13+
14+
RequestApi Library é um pequeno conjunto de classes desenvolvidas pela **[Suporte Informátika](https://www.suporteinformatika.com.br)** para facilitar a comunicação com API's e formulários de terceiros.
15+
16+
Você pode saber mais **[clicando aqui](https://www.suporteinformatika.com.br)**.
17+
18+
### Highlights
19+
20+
- Simple installation (Instalação simples)
21+
- Easy abstraction of API's (Facíl abstração de API's)
22+
- Easy implementation with forms (Facíl implementação com formulários)
23+
- Composer ready and PSR-2 compliant (Pronto para o composer e compatível com PSR-2)
24+
25+
## Installation
26+
27+
Uploader is available via Composer:
28+
29+
```bash
30+
"caiolandgraf/requestapi": "^1.0"
31+
```
32+
33+
or run
34+
35+
```bash
36+
composer require caiolandgraf/requestapi
37+
```
38+
39+
## Documentation
40+
41+
###### For details on how to use, see a sample folder in the component directory. In it you will have an example of use for each class. It works like this:
42+
43+
Para mais detalhes sobre como usar, veja uma pasta de exemplo no diretório do componente. Nela terá um exemplo de uso para cada classe. Ele funciona assim:
44+
45+
#### Api's Abstraction :
46+
47+
```php
48+
<?php
49+
50+
require __DIR__ . "/../vendor/autoload.php";
51+
52+
use CaioLandgraf\Api\RequestApi;
53+
54+
$request = new RequestApi("https://www.apiurl.com");
55+
56+
// login
57+
$request->post([
58+
"login" => "email@suporteinformatika.com.br",
59+
"password" => "password"
60+
], "login");
61+
62+
// read
63+
$user = $request->get([
64+
"id" => "1"
65+
], "user");
66+
67+
//update
68+
$user->put([
69+
"first_name" => "Caio",
70+
"last_name" => "Landgraf",
71+
"genre" => "male",
72+
"datebirth" => "1980-01-02",
73+
"document" => "888888888"
74+
], "user/update");
75+
76+
//test and result
77+
if ($user->error()) {
78+
$user->error(); //object
79+
} else {
80+
$user->response(); //object
81+
}
82+
```
83+
84+
#### Form abstraction
85+
86+
```php
87+
<?php
88+
89+
require __DIR__ . "/../vendor/autoload.php";
90+
91+
use CaioLandgraf\Api\RequestApi;
92+
93+
$request = new RequestApi("https://www.form.com/contact");
94+
95+
$request->post([
96+
"name" => "Name",
97+
"email" => "email@suporteinformatika.com.br",
98+
"subject" => "Subject",
99+
"message" => "Message"
100+
]);
101+
102+
//test and result
103+
if ($request->error()) {
104+
$request->error(); //object
105+
} else {
106+
$request->response(); //object
107+
}
108+
```
109+
110+
## Contributing
111+
112+
Please see [CONTRIBUTING](https://github.com/caiolandgraf/uploader/blob/master/CONTRIBUTING.md) for details.
113+
114+
## Support
115+
116+
###### Security: If you discover any security related issues, please email eu.caiolandgraf@gmail.com instead of using the issue tracker.
117+
118+
Se você descobrir algum problema relacionado à segurança, envie um e-mail para eu.caiolandgraf@gmail.com em vez de usar o rastreador de problemas.
119+
120+
Thank you
121+
122+
## Credits
123+
124+
- [Caio Landgraf](https://github.com/caiolandgraf) (Developer)
125+
- [Suporte Informatika](https://github.com/caiolandgraf) (Team)
126+
- [All Contributors](https://github.com/caiolandgraf/requestapi/contributors) (This Rock)
127+
128+
## License
129+
130+
The MIT License (MIT). Please see [License File](https://github.com/caiolandgraf/requestapi/blob/master/LICENSE) for more information.

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "caiolandgraf/resquest-api",
3+
"description": "Biblioteca para consumo e envio de formulários e api's",
4+
"keywords": [
5+
"FSPHP",
6+
"Suporte Informatika",
7+
"Caio Landgraf",
8+
"SaaS",
9+
"PHP",
10+
"Full Stack",
11+
"API",
12+
"Request",
13+
"CURL"
14+
],
15+
"homepage": "https://www.suporteinformatika.com.br",
16+
"license": "MIT",
17+
"authors": [
18+
{
19+
"name": "Caio Landgraf",
20+
"email": "eu.caiolandgraf@gmail.com",
21+
"role": "Developer"
22+
}
23+
],
24+
"require": {
25+
"php": "^7.3",
26+
"ext-json": "*",
27+
"ext-curl": "*"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"CaioLandgraf\\RequestApi\\": "src"
32+
}
33+
}
34+
}

composer.lock

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.phar

2.07 MB
Binary file not shown.

example/api.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
require __DIR__ . "/../vendor/autoload.php";
4+
5+
use CaioLandgraf\Api\RequestApi;
6+
7+
$request = new RequestApi("https://www.apiurl.com");
8+
9+
// login
10+
$request->post([
11+
"login" => "email@suporteinformatika.com.br",
12+
"password" => "password"
13+
], "login");
14+
15+
// read
16+
$user = $request->get([
17+
"id" => "1"
18+
], "user");
19+
20+
//update
21+
$user->put([
22+
"first_name" => "Caio",
23+
"last_name" => "Landgraf",
24+
"genre" => "male",
25+
"datebirth" => "1980-01-02",
26+
"document" => "888888888"
27+
], "user/update");
28+
29+
//test and result
30+
if ($user->error()) {
31+
$user->error(); //object
32+
} else {
33+
$user->response(); //object
34+
}

0 commit comments

Comments
 (0)