cancel
Showing results for 
Search instead for 
Did you mean: 

How to call the Updating a user's picture API By C#?

robbie
Champ in-the-making
Champ in-the-making
when I call following method,then return the error message:Cannot send a content-body with this verb-type.How to build the request body?
The requestBodyData is byte[] data for the photo.

The sourceCode:
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://serverName:8080/activiti-rest/service/kermit/picture");
                webRequest.Method = "GET";
                webRequest.ContentType = "multipart/form-data";
                webRequest.Timeout = 1000*60;

                CredentialCache setCredential = new CredentialCache();
                setCredential.Add(new Uri(requestUrl), "Basic", new NetworkCredential("kermit", "kermit"));
                webRequest.Credentials = setCredential;
                webRequest.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(new ASCIIEncoding().GetBytes("kermit"+ ":" + "kermit")));
                if (requestBodyData != null)
                {
                    webRequest.ContentLength = requestBodyData.Length;
                    Stream dataStream = webRequest.GetRequestStream();
                    dataStream.Write(requestBodyData, 0, requestBodyData.Length);
                    dataStream.Close();
                }
          HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
1 REPLY 1

robbie
Champ in-the-making
Champ in-the-making
Are there anyone can help me?thanks.The question is how to build the API's request body?
e.g:create a new binary variable on a process-instance
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.