DonRichie edited a comment on issue #161:
URL:
https://github.com/apache/openwhisk-runtime-go/issues/161#issuecomment-1043713063
**I actually managed to set a header:**
```
package main
import (
"fmt"
"encoding/json"
)
func PrettyPrint(v interface{}) (err error) {
b, err := json.MarshalIndent(v, "", " ")
if err == nil {
fmt.Println(string(b))
}
return
}
func Main(inobj map[string]interface{}) map[string]interface{} {
fmt.Println("inobj:")
PrettyPrint(inobj)
// assemble response
outobj := make(map[string]interface{})
header_map := make(map[string]string)
header_map["headername"]= "headerval"
outobj["headers"] = header_map
outobj["statusCode"] = 201
outobj["body"] = "123"
fmt.Println("outobj:")
PrettyPrint(outobj)
return outobj
}
```
I hereby request to extend the documentation with a nice example.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]