Exemplo n.º 1
0
 public IEnumerator DeleteAdmin(AdminData admin,
                                Action <long> onSuccess, Action <ErrorDetails> onError)
 {
     return(WebRequest(
                RequestType.kDELETE,
                $"{baseURI}/admins",
                ConvertOnSuccess(onSuccess),
                onError,
                JSONRequestBody.FromObject(admin)));
 }
Exemplo n.º 2
0
 public IEnumerator PostLogin(LoginRequestData request,
                              Action <LoginResponse, long> onSuccess, Action <ErrorDetails> onError)
 {
     return(WebRequest(
                RequestType.kPOST,
                $"{baseURI}/auth",
                ConvertOnSuccess(PeekLoginResponse(onSuccess)),
                onError,
                JSONRequestBody.FromObject(request)));
 }
Exemplo n.º 3
0
        public IEnumerator PostFile(string fileName, byte[] data,
                                    Action <long> onSuccess, Action <ErrorDetails> onError)
        {
            FileUploadData uploadData = new FileUploadData()
            {
                filename = fileName,
                data     = Convert.ToBase64String(Compression.Deflate(data))
            };

            return(WebRequest(
                       RequestType.kPOST,
                       $"{baseURI}/files",
                       ConvertOnSuccess(onSuccess),
                       onError,
                       JSONRequestBody.FromObject(uploadData)));
        }