public async Task <Capability> CreateCapability(string name, string description) { var content = new StringContent( content: _serializer.Serialize(new { Name = name, Description = description }), encoding: Encoding.UTF8, mediaType: "application/json" ); var response = await _client.PostAsync("/api/v1/capabilities", content); await HttpResponseHelper.MapStatusCodeToException(response); var receivedContent = await response.Content.ReadAsStringAsync(); return(_serializer.Deserialize <Capability>(receivedContent)); }
public async Task <Topic> CreateTopic(string capabilityId, CreateTopicRequest createTopicRequest) { var reqContent = new StringContent( content: _serializer.Serialize(createTopicRequest), encoding: Encoding.UTF8, mediaType: "application/json" ); var response = await _client.PostAsync($"/api/v1/capabilities/{capabilityId}/topics", reqContent); await HttpResponseHelper.MapStatusCodeToException(response); var content = await response.Content.ReadAsStringAsync(); return(_serializer.Deserialize <Topic>(content)); }