Advice on returning Content from HTTPTrigger Azure Functions function
See original GitHub issueHi @dsyme,
I’ve used your example https://github.com/Azure/azure-webjobs-sdk-script/blob/dev/sample/HttpTrigger-FSharp/run.fsx for a HttpTrigger AF. I do get a 200 but unfortunately no content. I’ve triggered it from postman. I see that Content isn’t a valid HttpResponseMessage constructor parameter so I supply it, as a test for now, just before the return:
let res =
match queryParams.TryGetValue("name") with
| true, name ->
new HttpResponseMessage(HttpStatusCode.OK, Content = new StringContent("Hello " + name))
| _ ->
new HttpResponseMessage(HttpStatusCode.BadRequest, Content = new StringContent("Please pass a name on the query string"))
res.Content <- new StringContent("Hello ")
log.Info(sprintf "Response=%A" res)
return res
Do you have any advice on getting this to return content?
Warmest regards,
Garrard.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Azure Functions HTTP trigger
The HTTP trigger lets you invoke a function with an HTTP request. You can use an HTTP trigger to build serverless APIs and...
Read more >Azure Function Return String in Http Response
Since your application is running as a separate process to the host, you can't just return an object reference as output from your...
Read more >Azure Functions: return content as HTML
Azure Functions : Return content as HTML ; Let's first create a Functions App targeting .NET Core 3.1 as a stack and create...
Read more >Returning HTTP Status Codes from Azure Functions
When creating HTTP-triggered Azure Functions there are a number of ways to indicate results back to the calling client.
Read more >Azure Functions HTTP Trigger - YouTube
0:00 Intro 1:19 Demo 13:32 Conclusion Azure Functions University - https://github.com/marcduiker/ azure - functions -university - Follow Marc ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @ahmelsayed, oh dear, drops head in shame, I didn’t have an output http bindng. Working as expected.
Logged: https://github.com/Azure/azure-webjobs-sdk-script/issues/636