// Decode decodes the given string using the given media type and returns the decoded bytes.
Decode decodes the given string using the given media type and returns the decoded bytes.
// Decode decodes the given string using the given media type and returns the decoded bytes .
func Decode(content string, mediaType MediaType) ([]byte, error) {
	switch mediaType {
	case GzipMediaType:
		return GzipDecompress(content)
	case JSONMediaType:
		return []byte(content), nil
	case "":
		return nil, fmt.Errorf("media type not specified")
	default:
		return nil, fmt.Errorf("unsupported media type [%s]", mediaType)
	}
}
func Decode ( content string , mediaType MediaType ) ( [ ] byte , error ) { switch mediaType { case GzipMediaType : return GzipDecompress ( content ) case JSONMediaType : return [ ] byte ( content ) , nil case " " : return nil , fmt . Errorf ( " " ) default : return nil , fmt . Errorf ( " " , mediaType ) } }
Decode decodes the given string using the given media type and returns the decoded bytes.
Decode decodes the given string using the given media type and returns the decoded bytes .