Home >Common Problem >What are the methods of response object?

What are the methods of response object?

青灯夜游
青灯夜游Original
2020-11-18 16:47:0710992browse

The methods of the response object include: AddHeader method, AppendToLog method, BinaryWrite method, Clear method, End method, Flush method, Redirect method, and Write method.

What are the methods of response object?

The Response object is an object used to dynamically respond to client requests, control the information sent to the user, and dynamically generate a response. The Response object only provides a data collection cookie, which is used to write cookie values ​​on the client side. If the specified cookie does not exist, create it. If present, it will be updated automatically. The results are returned to the client browser.

The Response object is used to dynamically respond to client requests and return dynamically generated response results to the client browser. Use the Response object to send information directly to the browser, redirect the browser to another URL or set the value of a cookie, etc.

Methods of the response object:

  • AddHeader: Adds new HTTP headers and values ​​to the HTTP response.

  • AppendToLog: Appends a string to the end of the server log entry.

  • BinaryWrite: Write data directly to the output without any character conversion.

  • Clear: Clear buffered HTML output.

  • #End: Stop processing the script and return the current result.

  • #Flush: Send buffered HTML output immediately.

  • #Redirect: Redirect the user to a different URL.

  • #Write: Write the specified string to the output.

For more programming-related knowledge, please visit: Programming Teaching! !

The above is the detailed content of What are the methods of response object?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn