Reputation: 15
In a socket programming, I must display multiple Content-Types.
ex)
Content-Type : text/html, text/css, text/javascript, image/png
However, this code doesn't work. How can I display multiple Content-Type in a HTTP response message? Thank you...
Upvotes: 1
Views: 10316
Reputation: 23786
Content-Type
means should be only one type based on the requester's Accept
parameter of a default content type you may specify, however if your client is interested in a specific type, it should send the type he wants in Accept
request header and you should respond back with the requested content type.
requester may send multiple types through to say for example
Accept: application/json
Accept: text/html
which means the requester can understand both types. If server can serve and respond back in json
format otherwise it should response back with text/html
More info on Content-Type
header and other HTTP
specs, please check this
Upvotes: 3