The 2.4 _ typeHTTP parameter sometimes indicates that an xml request is sent by a framework. We only need one or no permission to control the http header sent to the server. This often happens when ajax technology is used. In this case, the browser has time to request the html response (homepage), and sometimes the xml response (special content ). The problem with this scenario is:
The 2.4 _ type HTTP parameter sometimes indicates that an xml request is sent by a framework. We only need one or no permission to control the http header sent to the server. This often happens when ajax technology is used. In this case, the browser has time to request the html response (homepage), and sometimes the xml response (special content ). The problem with this scenario is:
HTTP parameters of 2.4 _ type
Sometimes an xml request may represent a framework. We only use one or no permission to control the http header sent to the server. This often happens when ajax technology is used. In this case, the browser has time to request the html response (homepage), and sometimes the xml response (special content ). The problem in this scenario is that, from the server perspective, the headers of html and xml requests sent by the browser are the same. In this case, the framework will always use html requests even if we want xml responses. The Accept field of the http header should be text/html.
_ Type HTTP is used to solve this problem. The _ type parameter value can be web or r ws_stateless (ws), which indicates the desired response type, regardless of how the http header is set from the client to the server.
The following is an example of a url that requires a traditional web response:
Http://example.com/forum/topics? _ Type = web
The following is an example of a url that expects an xml web service response:
Http://example.com/forum/topics? _ Type = ws_stateless
Or the following convenient shorthand form:
Http://example.com/forum/topics? _ Type = ws
The usage of this parameter is displayed. As described above, the type parameter overwrites the http header parameter:
When you use a browser to directly test the xml render method, this method is also useful and you can see the results directly.