|
|
@ -10,6 +10,7 @@ import ( |
|
|
|
// MIME
|
|
|
|
// MIME
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
MIMEJSON = "application/json" |
|
|
|
MIMEJSON = "application/json" |
|
|
|
|
|
|
|
MIMEJSON2 = "text/json" |
|
|
|
MIMEHTML = "text/html" |
|
|
|
MIMEHTML = "text/html" |
|
|
|
MIMEXML = "application/xml" |
|
|
|
MIMEXML = "application/xml" |
|
|
|
MIMEXML2 = "text/xml" |
|
|
|
MIMEXML2 = "text/xml" |
|
|
@ -63,7 +64,7 @@ func Default(method, contentType string) Binding { |
|
|
|
|
|
|
|
|
|
|
|
contentType = stripContentTypeParam(contentType) |
|
|
|
contentType = stripContentTypeParam(contentType) |
|
|
|
switch contentType { |
|
|
|
switch contentType { |
|
|
|
case MIMEJSON: |
|
|
|
case MIMEJSON, MIMEJSON2: |
|
|
|
return JSON |
|
|
|
return JSON |
|
|
|
case MIMEXML, MIMEXML2: |
|
|
|
case MIMEXML, MIMEXML2: |
|
|
|
return XML |
|
|
|
return XML |
|
|
|