File tree Expand file tree Collapse file tree
EventHub.RestClientGenerator/UwpTextTemplate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public virtual string TransformText()
4545 #line default
4646 #line hidden
4747 this . Write ( @"
48- public async Task PostDataAsync(string jsonObjectToSend)
48+ public async Task<bool> PostDataAsync(string jsonObjectToSend)
4949 {
5050 var httpClient = new HttpClient();
5151
@@ -55,6 +55,8 @@ public async Task PostDataAsync(string jsonObjectToSend)
5555 content.Headers.Add(""ContentType"", ""application/json"");
5656
5757 var result = await httpClient.PostAsync(url, content);
58+
59+ return result.IsSuccessStatusCode;
5860 }
5961 }
6062}" ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace YourNamespace
1414 {
1515 const string SharedAccessSignature = <#=SharedAccessSignature#>;
1616 const string Url = <#=EventHubRestUri#>
17- public async Task PostDataAsync(string jsonObjectToSend)
17+ public async Task<bool> PostDataAsync(string jsonObjectToSend)
1818 {
1919 var httpClient = new HttpClient();
2020
@@ -24,6 +24,8 @@ namespace YourNamespace
2424 content.Headers.Add("ContentType", "application/json");
2525
2626 var result = await httpClient.PostAsync(url, content);
27+
28+ return result.IsSuccessStatusCode;
2729 }
2830 }
2931}
You can’t perform that action at this time.
0 commit comments