Skip to content

Commit 9cac881

Browse files
author
Lucas Wang
authored
Improve the content type error message by showing available content types (#3532)
1 parent b5ca550 commit 9cac881

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

dgraph/cmd/alpha/http.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ func queryHandler(w http.ResponseWriter, r *http.Request) {
200200
params.Query = string(body)
201201

202202
default:
203-
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type")
203+
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type. "+
204+
"Supported content types are application/json, application/graphqlpm")
204205
return
205206
}
206207

@@ -327,7 +328,8 @@ func mutationHandler(w http.ResponseWriter, r *http.Request) {
327328
}
328329

329330
default:
330-
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type")
331+
x.SetStatus(w, x.ErrorInvalidRequest, "Unsupported Content-Type. "+
332+
"Supported content types are application/json, application/rdf")
331333
return
332334
}
333335

0 commit comments

Comments
 (0)