Comments (6)
Hi! Yes, you may to implement some API-classes and use them from different models or by direct.
Did you see example application code? Link: https://github.com/kafeg/qtrest-example
from qtrest.
Hi! Library not supported user/pass authorization by authTokenHeader/authToken
If you send username|password via headers, you must to override method
virtual QNetworkRequest createRequest(const QUrl &url) const;
If you send username/password in request body, you must set them in each request in your API class.
from qtrest.
I think I missed that example
Thanks a lot!
from qtrest.
I started hacking today and it's going nice :)
One problem is that I'm unable to use the basic HTTP auth method, which uses username and password.
I tried thses, but none of them worked for me:
authTokenHeader: "Authorization"
authToken: "username password"
-----
authTokenHeader: "Basic"
authToken: "password"
-----
authTokenHeader: "username"
authToken: "password"
Maybe something is wrong with the website, but I want to be sure what is the right way to use it!
Thanks a lot! Really nice library.
from qtrest.
Yes! Thanks that worked! :)
Now a question, if I have a request that gets an object instead of a list, it it possible to parse it with any method right now? All what I found are lists :)
I found the implementation of getCouponDetail
, but it seems it's not used.
An example of returned JSON:
{
"YML_KEY": {
"mimetype": "text/plain",
"file-extensions": ".yml, .yaml",
"description": "YAML Files based on the content"
},
"PHP_INI_KEY": {
"mimetype": "text/plain",
"file-extensions": ".ini",
"description": "PHP INI Files based on content"
},
"XLIFF": {
"mimetype": "text/xml",
"file-extensions": ".xlf, .xliff, .xml",
"description": "XLIFF file"
},
...
}
UPDATE
I think I'll inspire from the library as there are several special hacks that I need to to! Thanks anyway!
from qtrest.
Hi! Please see to function QVariantList AbstractJsonRestListModel::getVariantList(QByteArray bytes) in file src/models/abstractjsonrestlistmodel.cpp
You may use QVariantList and QVariant for get subarray data by QVariant::toJsonArray() / toJsonDocument() / toJsonObject() / toJsonValue().
In QML it's doing automatically, as i test it a year ago)
from qtrest.
Related Issues (6)
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 qtrest.