-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from proyecto26/develop
Release 2.6.2
- Loading branch information
Showing
37 changed files
with
730 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- release | ||
jobs: | ||
split-upm: | ||
name: split upm branch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: split upm branch | ||
run: | | ||
git branch -d upm &> /dev/null || echo upm branch not found # recreate the upm branch each time | ||
git mv "$PKG_ROOT" "src/$UPM_ROOT" | ||
git mv "src/$UPM_ROOT" . | ||
git mv demo/Assets demo/Sample | ||
git mv demo/Sample $UPM_ROOT | ||
git mv doc Docs | ||
git mv Docs $UPM_ROOT | ||
git mv LICENSE $UPM_ROOT | ||
git mv README.md $UPM_ROOT | ||
git mv SECURITY.md $UPM_ROOT | ||
git mv CHANGELOG.md $UPM_ROOT | ||
git mv CONTRIBUTING.md $UPM_ROOT | ||
echo "********************** ROOT **********************" | ||
ls | ||
git add "$UPM_ROOT" | ||
git config --global user.name 'github-bot' | ||
git config --global user.email '[email protected]' | ||
git commit -m "create release folder" | ||
git subtree split -P "$UPM_ROOT" -b upm # create the upm branch | ||
git checkout upm # checkout the branch | ||
if [[ -d "Sample/Packages" ]]; then | ||
git rm -rf Sample/Packages | ||
git rm Sample/Packages.meta --ignore-unmatch | ||
git rm Sample/packages.config | ||
git rm Sample/packages.config.meta --ignore-unmatch | ||
fi | ||
if [[ -d "Properties" ]]; then | ||
git rm -rf Properties | ||
git rm Properties.meta --ignore-unmatch | ||
git rm Proyecto26.RestClient.csproj | ||
git rm Proyecto26.RestClient.csproj.meta --ignore-unmatch | ||
git rm Proyecto26.RestClient.nuspec | ||
git rm Proyecto26.RestClient.nuspec.meta --ignore-unmatch | ||
git rm packages.config | ||
git rm packages.config.meta --ignore-unmatch | ||
fi | ||
git commit -am "fix: src => root" | ||
echo "********************** ROOT **********************" | ||
ls | ||
git push -u origin upm --force # commit the branch | ||
env: | ||
PKG_ROOT: src/Proyecto26.RestClient | ||
UPM_ROOT: Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Contributing | ||
|
||
When contributing to this repository, please first discuss the change you wish to make via issue, | ||
email, or any other method with the owners of this repository before making a change. | ||
|
||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
## Pull Request Process | ||
|
||
1. Ensure any install or build dependencies are removed before the end of the layer when doing a | ||
build. | ||
2. Update the README.md with details of changes to the interface, this includes new environment | ||
variables, exposed ports, useful file locations and container parameters. | ||
3. Increase the version numbers in any examples files and the README.md to the new version that this | ||
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). | ||
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you | ||
do not have permission to do that, you may request the second reviewer to merge it for you. | ||
|
||
## Code of Conduct | ||
|
||
### Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to making participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, gender identity and expression, level of experience, | ||
nationality, personal appearance, race, religion, or sexual identity and | ||
orientation. | ||
|
||
### Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
### Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
|
||
### Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. Examples of | ||
representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. Representation of a project may be | ||
further defined and clarified by project maintainers. | ||
|
||
### Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [email protected]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
|
||
### Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
[![Made with Unity](https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat&logo=unity)](https://assetstore.unity.com/publishers/32542) | ||
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/969f6b9d04324af58382f7ee7a8faccd)](https://app.codacy.com/app/jdnichollsc/RestClient?utm_source=github.com&utm_medium=referral&utm_content=proyecto26/RestClient&utm_campaign=Badge_Grade_Dashboard) | ||
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-brightgreen.svg)](https://github.com/proyecto26/RestClient/graphs/commit-activity) | ||
[![Tidelift Subscription](https://tidelift.com/badges/package/nuget/Proyecto26.RestClient)](https://tidelift.com/subscription/pkg/nuget-proyecto26-restclient?utm_source=nuget-proyecto26-restclient&utm_medium=referral&utm_campaign=readme) | ||
[![Build Status](https://travis-ci.org/proyecto26/RestClient.svg?branch=master)](https://travis-ci.org/proyecto26/RestClient) | ||
|
@@ -55,6 +54,7 @@ RestClient.GetArray<Post>(api + "/posts").Then(response => { | |
- Handle HTTP exceptions in a better way | ||
- Retry HTTP requests easily | ||
- Open Source 🦄 | ||
- Utility to work during scene transition | ||
|
||
## Supported platforms 📱 🖥 | ||
The [UnityWebRequest](https://docs.unity3d.com/Manual/UnityWebRequest.html) system supports most Unity platforms: | ||
|
@@ -79,7 +79,10 @@ Do you want to see this beautiful package in action? Download the demo [here](ht | |
### Unity package | ||
Download and install the **.unitypackage** file of the latest release published [here](https://github.com/proyecto26/RestClient/releases). | ||
|
||
### Nuget package | ||
### UPM package | ||
Make sure you had installed [C# Promise package](https://openupm.com/packages/com.rsg.promise/) or at least have it in your [openupm scope registry](https://openupm.com/). Then install **RestClient package** using this URL from **Package Manager**: `https://github.com/proyecto26/RestClient.git#upm` | ||
|
||
### NuGet package | ||
Other option is download this package from **NuGet** with **Visual Studio** or using the **nuget-cli**, a **[NuGet.config](https://github.com/proyecto26/RestClient/blob/master/demo/NuGet.config)** file is required at the root of your **Unity Project**, for example: | ||
|
||
```xml | ||
|
@@ -112,6 +115,13 @@ RestClient.Head("https://jsonplaceholder.typicode.com/posts").Then(response => { | |
}); | ||
``` | ||
|
||
## Handling during scene transition | ||
```csharp | ||
ExecuteOnMainThread.RunOnMainThread.Enqueue(() => { | ||
//Any API call using RestClient | ||
}); | ||
``` | ||
|
||
### Generic Request Method | ||
And we have a generic method to create any type of request: | ||
```csharp | ||
|
@@ -137,7 +147,9 @@ RestClient.Request(new RequestHelper { | |
ContentType = "application/json", //JSON is used by default | ||
Retries = 3, //Number of retries | ||
RetrySecondsDelay = 2, //Seconds of delay to make a retry | ||
RetryCallbackOnlyOnNetworkErrors = true, //Invoke RetryCallack only when the retry is provoked by a network error | ||
RetryCallback = (err, retries) => {}, //See the error before retrying the request | ||
ProgressCallback = (percent) => {}, //Reports progress of the request from 0 to 1 | ||
EnableDebug = true, //See logs of the requests for debug mode | ||
IgnoreHttpException = true, //Prevent to catch http exceptions | ||
ChunkedTransfer = false, | ||
|
@@ -152,6 +164,9 @@ RestClient.Request(new RequestHelper { | |
AssetBundle assetBundle = ((DownloadHandlerAssetBundle)response.Request.downloadHandler).assetBundle; | ||
|
||
EditorUtility.DisplayDialog("Status", response.StatusCode.ToString(), "Ok"); | ||
}).Catch(err => { | ||
var error = err as RequestException; | ||
EditorUtility.DisplayDialog("Error Response", error.Response, "Ok"); | ||
}); | ||
``` | ||
|
||
|
@@ -257,6 +272,14 @@ currentRequest.DownloadedBytes; //The number of bytes of body data the system ha | |
currentRequest.Abort(); //Abort the request manually | ||
``` | ||
|
||
Additionally we can run a callback function whenever a progress change happens! | ||
```csharp | ||
RestClient.Get(new RequestHelper { | ||
Uri = "https://jsonplaceholder.typicode.com/users", | ||
ProgressCallback = percent => Debug.Log(percent) | ||
}); | ||
``` | ||
|
||
Later we can clear the default headers and params for all requests | ||
```csharp | ||
RestClient.ClearDefaultHeaders(); | ||
|
@@ -295,19 +318,42 @@ router.post('/', function(req, res) { | |
}); | ||
``` | ||
|
||
## Collaborators 🥇 | ||
## Credits 👍 | ||
* **C-Sharp-Promise:** [Promises library for C# for management of asynchronous operations.](https://github.com/Real-Serious-Games/C-Sharp-Promise) | ||
* **MyAPI:** [A template to create awesome APIs easily ⚡️](https://github.com/proyecto26/MyAPI) | ||
|
||
## Contributing ✨ | ||
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. | ||
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated** ❤️. | ||
You can learn more about how you can contribute to this project in the [contribution guide](https://github.com/proyecto26/RestClient/blob/develop/CONTRIBUTING.md). | ||
|
||
## Contributors ✨ | ||
Please do contribute! Issues and pull requests are welcome. | ||
|
||
### Code Contributors | ||
|
||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. | ||
|
||
[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/0)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/0)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/1)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/1)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/2)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/2)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/3)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/3)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/4)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/4)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/5)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/5)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/6)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/6)[![](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/images/7)](https://sourcerer.io/fame/jdnichollsc/proyecto26/RestClient/links/7) | ||
|
||
### Collaborators | ||
<!-- COLLABORATORS-LIST:START - Do not remove or modify this section --> | ||
[<img alt="jdnichollsc" src="https://avatars3.githubusercontent.com/u/2154886?v=3&s=117" width="117">](https://github.com/jdnichollsc) | [<img alt="diegoossa" src="https://avatars3.githubusercontent.com/u/3436237?v=3&s=117" width="117">](https://github.com/diegoossa) | [<img alt="nasdull" src="https://avatars3.githubusercontent.com/u/25492923?v=3&s=117" width="117">](https://github.com/nasdull) | | ||
:---: | :---: | :---: | | ||
[Juan Nicholls](mailto:[email protected]) | [Diego Ossa](mailto:[email protected]) | [Nasdull](mailto:[email protected]) | | ||
|
||
## Credits 👍 | ||
* **Promises library for C#:** [Real Serious Games/C-Sharp-Promise](https://github.com/Real-Serious-Games/C-Sharp-Promise) | ||
<!-- COLLABORATORS-LIST:END --> | ||
|
||
## Supporting 🍻 | ||
I believe in Unicorns 🦄 | ||
Support [me](http://www.paypal.me/jdnichollsc/2), if you do too. | ||
|
||
Any good review from the [Unity Store](https://assetstore.unity.com/packages/tools/network/rest-client-for-unity-102501) is also really appreciated! | ||
Donate **Ethereum**, **ADA**, **BNB**, **SHIBA**, **USDT**, **DOGE**: | ||
|
||
![Wallet address](https://user-images.githubusercontent.com/2154886/123501719-84bf1900-d60c-11eb-882c-98a499cea323.png) | ||
|
||
> Wallet address: 0x3F9fA8021B43ACe578C2352861Cf335449F33427 | ||
Please let us know your contributions! 🙏 | ||
|
||
## Enterprise 💼 | ||
|
||
|
@@ -318,6 +364,9 @@ The maintainers of RestClient for Unity and thousands of other packages are work | |
## Security contact information 🚨 | ||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. | ||
|
||
## License ⚖️ | ||
This repository is available under the [MIT License](https://github.com/proyecto26/RestClient/blob/develop/LICENSE). | ||
|
||
## Happy coding 💯 | ||
Made with ❤️ | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.