コード例 #1
0
        public async Task <string> BuildForm(string token, string formJSON, string path)
        {
            HttpResponseMessage response = null;
            string content = null;

            if (string.Empty.Equals(path))
            {
                // Create
                response = await _httpUtil.PostAsync(token, APIs.FORM_URL, formJSON);
            }
            else
            {
                // Edit
                response = await _httpUtil.PutAsync(token, APIs.ModifiedForm(path), formJSON);
            }

            if (response == null || !response.IsSuccessStatusCode)
            {
                return("{}");
            }

            content = await response.Content.ReadAsStringAsync();

            return(content);
        }
コード例 #2
0
        public async Task <string> InsertGroup(string token, string data)
        {
            HttpResponseMessage response = await _httpUtil.PostAsync(token, APIs.GetFormByAlias(Keywords.GROUP), data);

            if (response == null || response.StatusCode != HttpStatusCode.Created)
            {
                return("{}");
            }

            string content = await response.Content.ReadAsStringAsync();

            return(content);
        }