Coder Social home page Coder Social logo

http_header's Introduction

HTTP Header

Set the HTTP Headers for your template.

Parameters

  • status - input an HTTP Status code
  • location - set a location for redirection
  • content_type - set a Content-Type header
  • charset - set a charset in the Content-Type header
  • content_disposition - set a Content-Disposition (ex: attachment) with a filename
  • cache seconds - set to a non-zero number to set caching headers; set to 0 to force no-cache
  • terminate - set to "yes" to prevent any other output from the template

Examples

Do a 301 redirect

{exp:http_header status="301" location="{path=site/something}" terminate="yes"}

Set a 404 Status header

{exp:http_header status="404"}

Set the Content-Type header to application/json

{exp:http_header content_type="application/json"}

Set Content-Disposition to force the download

{exp:http_header content_disposition="attachment" filename="myfile.xml"}

Set the Pragma, Cache-control, and Expires headers to set a 5 minute (300 second) cache

{exp:http_header cache_seconds="300"}

Set the Content-Language header to "en"

{exp:http_header content_language="en"}

http_header's People

Contributors

ccorda avatar loren138 avatar mimo84 avatar patrickash avatar pvledoux avatar rsanchez avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.