jaksab / easynetwork Goto Github PK
View Code? Open in Web Editor NEWDevelop by onCreate team (http://oncreate.pro)
License: MIT License
Develop by onCreate team (http://oncreate.pro)
License: MIT License
It is necessary to provide redirects handling:
When using Request.setContentType(NConst.MIME_TYPE_JSON)
all parameters added via addParam
are serialized as strings:
{"projectId":"471","text":"","status":"pending approval","fileId":"7230"}
In some cases there is a requirement for numeric type in JSON (fileId
in this example):
{"projectId":"471","text":"","status":"pending approval","fileId":7230}
In current version 1.4.2 there is no way to serialize parameter as a number.
Hi
What i'm seeking is to override addOnErrorDefaultListener and resend the request with all its parameters after it fails (cause of bad network for example)
Is there a way to do it without having to catch these events on every requests of every activity ?
Проблемный коммит: b3f122e
Поведение в предыдущих версиях:
[Query params]: q=Luke+Bryan++Brett+Eldredge+%26+Granger+Smith+Klipsch+Music+Center; imageType=photo; mkt=en-us; offset=0; count=4
Поведение в версии 1.2.6 и выше:
[Query params]: q=Dallas Cowboys vs. Green Bay Packers AT; T Stadium; imageType=photo; mkt=en-us; offset=0; count=4
Add a handler for calculating the request execution progress. It can be implemented in new method onProgress(int progress, NRequestModel requestModel) of NCallback class.
Is there a way to write codes in the doInBackground method of the Asynctask ?
All the overrided methods happens on the main UI thread.
What I want is sleep the backgruond thread for atleast 1 sec so that the progress dialog doesn't show and hide too quickly
Thanks
Call NBaseCallback#stopProgressDialog in NTask#onPostExecute (failed else).
Running the following request fails in version 1.4.1.
EasyNet.put()
.setUrl(destinationUrl)
.setContentType("image/png")
.addParam(imageFile);
Log output:
I/EasyNetwork: [PUT] https://storage.googleapis.com/...
I/EasyNetwork: [Headers]: User-Agent=App-Android/1.0-dev Dalvik/2.1.0 (Linux; U; Android 9; Android SDK built for x86 Build/PSR1.180720.075); Content-Type=image/png;
I/EasyNetwork: [Error]: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
So far the only way i found to send a json is to add parameters one by one
The method .setBody(body) doesn't seem to do anything.
If I want to send a post or a put with nested json ,say i have this class
User {
int userId;
String userName;
City city;
}
City {
int cityId;
String cityName;
}
And my REST controller expect a JSON of type :
{
"userId": 1,
"name": "Name",
"city": {
"cityId": 1,
"cityName": "City1"
}
}
How can I post/put this in the body ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.