mirror of https://github.com/dapr/quickstarts.git
fix(go-http): requires content-type set to application/json
Signed-off-by: guergabo <guergabo@umich.edu>
This commit is contained in:
parent
bb3fb88677
commit
b830b8dda5
|
@ -34,6 +34,8 @@ func main() {
|
|||
log.Fatal(err.Error())
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
// Publish an event using Dapr pub/sub
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
|
|
|
@ -45,6 +45,7 @@ func postOrder(w http.ResponseWriter, r *http.Request) {
|
|||
log.Fatal(err)
|
||||
}
|
||||
var result Result
|
||||
fmt.Println(string(data))
|
||||
err = json.Unmarshal(data, &result)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
|
|
Loading…
Reference in New Issue