📜  什么是 rest api 中的接受标头 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:13.732000             🧑  作者: Mango

代码示例1
`Accept Header` can be used to ask the server to return
different type of response format 

For example :  

`/api/xname` endpoint , support both xml and json
as response type so we can add accept header `application/xml` 
to get xml result and `application/json` result. 

If server does not support such type ,
it will return `406`(not acceptable)  status code.