python - qt客户端有实现这样的功能的库函数吗?
PHPz
PHPz 2017-04-18 09:13:09
0
2
369

qt客户端有实现这样的功能的库函数吗?

########## File related
class UploadLinkView(APIView):

    def get(self, request, repo_id, format=None):
        if check_permission(repo_id, request.user.username) != 'rw':
            return api_error(status.HTTP_403_FORBIDDEN, "Can not access repo")

        if check_quota(repo_id) < 0:
            return api_error(HTTP_520_OPERATION_FAILED, 'Above quota')

        token = seafile_api.get_fileserver_access_token(
            repo_id, 'dummy', 'upload', request.user.username)
        url = gen_file_upload_url(token, 'upload-api')
        return Response(url)
        
        
        

qt客户端请求api,返回一个json字符串,字符串内容为一个url地址,qt客户端再去请求这个url地址。
这是文件上传功能,返回的url地址是监听8082端口的c服务。

PHPz
PHPz

学习是最好的投资!

reply all(2)
洪涛

Although I don’t understand Python, Qt/C++ and pyQt support the Internet.
Add the .pro file of the Qt project: QT += network
If you use C++, add the .h file:

#include <QNetworkAccessManager>  //网络访问管理
#include <QNetworkProxy>  //(可选)网络代理
#include <QNetworkReply>  //接收网络响应
#include <QNetworkRequest>  //发送网络请求

See Qt Network 5.7 in detail

左手右手慢动作

QT has its own network library, and QT5 has QNetworkAccessManager,QT4貌似有QHttpthat you can use. The official documentation for this kind of thing is very clear. .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template