Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6027565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:36:41+00:00 2026-05-23T04:36:41+00:00

The title is pretty self-explanatory. Is there any way to get the headers (except

  • 0

The title is pretty self-explanatory. Is there any way to get the headers (except for Rack::Request.env[])?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:36:42+00:00Added an answer on May 23, 2026 at 4:36 am

    The HTTP headers are available in the Rack environment passed to your app:

    HTTP_ Variables: Variables corresponding to the client-supplied HTTP request headers (i.e., variables whose names begin with HTTP_). The presence or absence of these variables should correspond with the presence or absence of the appropriate HTTP header in the request.

    So the HTTP headers are prefixed with “HTTP_” and added to the hash.

    Here’s a little program that extracts and displays them:

    require 'rack'
    
    app = Proc.new do |env|
      headers = env.select {|k,v| k.start_with? 'HTTP_'}
        .collect {|key, val| [key.sub(/^HTTP_/, ''), val]}
        .collect {|key, val| "#{key}: #{val}<br>"}
        .sort
      [200, {'Content-Type' => 'text/html'}, headers]
    end
    
    Rack::Server.start :app => app, :Port => 8080
    

    When I run this, in addition to the HTTP headers as shown by Chrome or Firefox, there is a “VERSION: HTPP/1.1” (i.e. an entry with key “HTTP_VERSION” and value “HTTP/1.1” is being added to the env hash).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe the title is pretty self-explanatory but still, maybe, I should ask in
The title pretty much explains it all, I have a Member object that references
I am using pretty much the same code to load my UIViewController (called LessonScrollView)
In the application I'm trying to develop I have UINavigationController as a root controller.
Rails adds a humanize() method for strings that works as follows (from the Rails
My models.py from django.db import models from django.contrib.auth.models import User class Song(models.Model): uploader =
I thought this would be something that's fairly common - but cant find it
I`m trying to customize my TabBar in xcode,ios, however I just found ppl saying
I am loading some images dynamically into a UITableView and creating some simple custom
I'm creating a game in objective C using the cocos 2d engine for iPhone.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.