Beispiel #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)));
 }
Beispiel #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)));
 }
Beispiel #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)));
        }