how to return HTTP status code in Open FaaS?

Ajaxe

How can a function deployed in openfaas return different HTTP status code to the caller? Like 4xx codes.

As per documentation, the watchdog would process the stdout or stderr for either a http status 200 or 5xx.

Is there a way to change the status like 400, 409 etc? I am using csharp template as downloaded by faas-cli

sutoL

You cant, as stated here https://github.com/openfaas/faas-netes/issues/147

The solution suggested is to return a payload with the status code, and parse the payload on the receiving end.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to return CREATED status (201 HTTP) in ResponseEntity

What is the HTTP status return code for a successful DELETE statement in REST?

How do I return a HTTP 404 status code from a SPA?

JAX-RS — How to return JSON and HTTP status code together?

How can I return HTTP status code 204 from a Django view?

Return HTTP status code 201 in flask

Return HTTP status code 201 in flask

Return HTTP response with status code 202 in Spring Boot

How can I send JSON via HTTP GET and get a status code in return?

Curl to return http status code along with the response

Laravel - Return json along with http status code

How to return a 200 HTTP Status Code from ASP.NET MVC 3 controller

How can I see the HTTP status code from the request made by page.open?

How to return both custom HTTP status code and content?

How to return Custom HTTP Status code + message in IEnumerable<xxx.Models.xxx> function

How to return a 404 HTTP status code when promise resolve to undefined in Nest?

How to http status code when return promise in lambda?

How to get HTTP status text from HTTP status code?

How to return different Http Status Code in ServiceStack

How to return 404 status code in ReactJS?

ActionFilter Return Http Status Code with Message

Return redirect HTTP status code in CouchDB show function

Http status code return

How do I return the HTTP Status Code from a method in my Web API to main?

How can I get a Lambda using AWS Gateway to return HTTP error status code in C#

How to return error message and HTTP status code together?

How to return the http status code using "graphql-request"?

How to return status code in response correctly?

How to return http error status code along with custom message in a class