Skip to content

Commit

Permalink
Display a note regarding func run http functions. Closes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmelsayed committed May 16, 2017
1 parent 0dd48bf commit f0e9c57
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public override async Task RunAsync()

var adminInvocation = JsonConvert.SerializeObject(new FunctionInvocation { Input = invocation });

if (functionMetadata.IsHttpFunction())
{
ColoredConsole.WriteLine(WarningColor("NOTE: the 'func run' command only supports POST for HTTP triggers. For other verbs, consider a REST client like cURL or Postman."));
}

var response = functionMetadata.IsHttpFunction()
? await client.PostAsync($"api/{FunctionName}", new StringContent(invocation, Encoding.UTF8, invocation.IsJson() ? "application/json" : "plain/text"))
: await client.PostAsync($"admin/functions/{FunctionName}", new StringContent(adminInvocation, Encoding.UTF8, "application/json"));
Expand Down

0 comments on commit f0e9c57

Please sign in to comment.