Esempio n. 1
0
 public void Delete(string requestUrl, HttpResponseMessageDelegate callbackOnResponse = null)
 {
     new Task(() =>
     {
         HttpResponseMessage result = m_client.DeleteAsync(m_endPoint + "/" + requestUrl).Result;
         callbackOnResponse?.Invoke(result);
     }).Start();
 }
Esempio n. 2
0
 public void Get(string requestUrl, HttpResponseMessageDelegate callbackOnResponse = null)
 {
     new Task(() =>
     {
         HttpResponseMessage response = m_client.GetAsync(m_endPoint + "/" + requestUrl).Result;
         string responseContent       = response.Content.ReadAsStringAsync().Result;
         callbackOnResponse?.Invoke(response);
     }).Start();
 }
Esempio n. 3
0
 public void PutJSON(string requestUrl, string jsonString, HttpResponseMessageDelegate callbackOnResponse = null)
 {
     new Task(() =>
     {
         StringContent data           = new StringContent(jsonString, System.Text.Encoding.UTF8, "application/json");
         HttpResponseMessage response = m_client.PutAsync(m_endPoint + "/" + requestUrl, data).Result;
         callbackOnResponse?.Invoke(response);
     }).Start();
 }
Esempio n. 4
0
 public void Put(string requestUrl, object objToSerialize, HttpResponseMessageDelegate callbackOnResponse = null)
 {
     PutJSON(requestUrl, JsonUtility.ToJson(objToSerialize), callbackOnResponse);
 }