Comments (16)
I've found a work around about this, you can catch the error in res variable
RestClient.Post<Info>(rh, new Info(), (err, res, body) =>
{
if (!String.IsNullOrEmpty(res.error))
{
Debug.Log("Errorr : " + res.error);
from restclient.
@jdnichollsc i've just tried running the latest release and run into this
https://github.com/proyecto26/RestClient/releases/download/1.2.1/RestClient.unitypackage
from restclient.
@jdnichollsc I've tried that with some public APIs as well as my own ASP.NET Core project. Looks like checking the error will be OK.
from restclient.
ok, let me fix that issue at night
from restclient.
@czuczorf ohh can you share a screenshot? I had not thought about that situation 😅
from restclient.
from restclient.
yes, let me check in a moment. Thanks for notify this issue 👍
from restclient.
Hi, Thanks a lot for updating the package, but I believe the issue is still present, Get()
is showing the no internet error but Post()
is not showing the same. Post method is only showing the success. You can check the screenshot attached.
I have produced this bug with :
- After Disconnect the wifi
- Change the APIs address to something else
from restclient.
Excellent, I need to add that validation with the promises 👍
from restclient.
I think the solution is modifying the following lines to validate if an error exist:
- https://github.com/proyecto26/RestClient/blob/master/src/Proyecto26.RestClient/HttpActions/HttpBase.cs#L17
- https://github.com/proyecto26/RestClient/blob/master/src/Proyecto26.RestClient/HttpActions/HttpBase.cs#L34
- https://github.com/proyecto26/RestClient/blob/master/src/Proyecto26.RestClient/HttpActions/HttpDelete.cs#L16
Example:
if (request.isDone && String.IsNullOrEmpty(res.error))
What do you think @czuczorf?
Let me know to publish a new release with that change :)
from restclient.
Hey. I accidentally wrote yesterday from the second, old account, I'm sorry.
Do you think it is enough to just check the res.error
? May be also check for the status code to be "2xx"? What do you think @jdnichollsc?
from restclient.
@davidorbelian I don't know if validating by the status code is the correct way, because exist a lot of different status, or if validating by a range would be better... What do you think? 🤔
from restclient.
@jdnichollsc I will check today after work if checking error value is enough and post the results here.
from restclient.
@davidorbelian thanks for your help! 👍
from restclient.
Fixing this issue with the version 1.2.2
from restclient.
@czuczorf @davidorbelian @itsharshdeep check the last release and let me know! 👍 https://github.com/proyecto26/RestClient/releases/tag/1.2.2
from restclient.
Related Issues (20)
- Update promises to be awaitable using `async`/`await` HOT 6
- Missing Meta files
- Empty response on RestClient GET, works with curl HOT 1
- Can this library be called by hololens2 HOT 4
- Can't send post request after Update to latest version HOT 2
- Lost reference to script in GET
- Can't use GET in hololens build
- Running multiple POST requests using Promise.ThenAll returns an IEnumerable of ResponseHelper objects, not all of them returned Data
- How can I add mode in proyecto26? HOT 1
- Post not working on WebGL compilation HOT 3
- Can i use this asset to make my offline game multiplayer? HOT 1
- Default seralizer JsonUtility cannot serialize records HOT 1
- Why not async/await? HOT 2
- Using RestClient as a dependency in a unity package HOT 1
- Error while downloading file from Firebase Storage
- Specified cast is not valid. HOT 1
- Crashlytics reporting constant Fatal Exception: java.lang.Exception
- JsonUtility.ToJson as serialization method doesn't support
- Stupid question, but what is the recommended way to return a value from a method? HOT 1
- Directus Auth - 400 bad request using rest client but functional old school way?? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restclient.