Forum Discussion
Al_Carandang_11 Nimbostratus
Nimbostratus
Jul 22, 2009HTTP::respond and HTTP/1.0
The wiki entry for HTTP::responds states    
     The response generated is always an HTTP/1.0 response. I was wondering why there is no option to return an HTTP/1.1 response or if there is, how would...
hoolio Cirrostratus
Cirrostratus
Nov 13, 2013In 11.2, an option was added to HTTP::respond which allows you to specify the response version:
https://devcentral.f5.com/wiki/iRules.http__respond.ashx
HTTP::respond < status code > [-version [1.0|1.1] ] [content < content value >] [noserver] [< header name > < header value >]+ Note: The -version flag was added in 11.2.0. It must immediately follow the status code and precede the content (if any) and any other flags.
You could check the client's HTTP version using [HTTP::version] in HTTP_REQUEST:
when HTTP_REQUEST {
   set version [HTTP::version]
}
when HTTP_RESPONSE {
   if {$some_condition == 1}{
       Use 1.0 unless the client version was 1.1
      if {$version ne "1.1"}{
         set version "1.0"
      }
       Send the response with the version set explicitly, no BIG-IP server header and some custom headers
      HTTP::respond 200 -version $version content "< html >Hi" noserver header1 value1 header2 value2
   }
}Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects