Simple API WebRequest system for Unity!
The goal of this repository is to make it easier to query text APIs using Unity.
🚧 Work in progress 🚧
Currently, this repository is in development.
Vangogh.Instance()
.GET(Url)
.WithGetResultAction((response) => { })
.Init();
See example of use: RequestManager.cs
.POST(Url)
.GET(Url)
.SetHeader("Header", "Value")
Vangogh.Instance()
.GET(Url)
.SetHeader("Authorization", "value")
.WithGetResultAction((response) => { })
.Init();
Supports as many headers as you need
Vangogh.Instance()
.GET(Url)
.SetHeader("Authorization", "value")
.SetHeader("Content-Type", "value")
.SetHeader("Any-Header-Name", "value")
.WithGetResultAction((response) => { })
.Init();
.SetEnableLog()
.SetBody("value")
Vangogh.Instance()
.GET(Url)
.SetBody("some-value")
.WithGetResultAction((response) => { })
.Init();
Sets the maximum number of attempts before terminating
.SetAttempts(int)
You can also set the time between attempts
.SetAttemptsDelay(float)
Vangogh.Instance()
.GET(Url)
.SetAttempts(3)
.SetAttemptsDelay(5f)
.WithGetResultAction((response) => { })
.Init();
Using single instance will terminating existing process with current url
.UseSingleInstance()
//Called when the process is started
.WithStartAction(() => { })
//Called when the process encounters an error
.WithErrorAction(() => { })
//Called when the process is done with results
.WithGetResultAction((response) => { })
Also:
- Supports native GET & POST
- Custom Headers.
- Custom Body.
- Standalone Builds ✔
- Android ✔
- iOS (maybe)
- WebGl ✔
Open Vangogh/Assets in unity or import the UnityPackage to your existing project or just copy Vangogh.cs and past in your project. Add the namespace to your scripts:
using NyanHeavyStudios.Vangogh;
▶ Based on Davinci structure by Shamsdev
Vangogh is available under the MIT license. See the LICENSE file for more info.