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

  • SEARCH
  • Home
  • 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 6835017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:10:56+00:00 2026-05-26T23:10:56+00:00

Possible Duplicate: Client-side detection of HTTP request method I’m working on Javascript that is

  • 0

Possible Duplicate:
Client-side detection of HTTP request method

I’m working on Javascript that is injected on any page. The script is injected on servers that I’m not controlling. (Injection is done with an add-on or bookmarklet.)

The Javascript needs to know whether the page was loaded as the result of an HTTP GET or POST. The reason for this is that if the page was loaded with a GET, the URL is an identifier for the page that can be bookmarked, shared with others, etc. In case of a POST, I need to handle it differently.

Can this be done? I have found no way of accessing the request from Javascript, but perhaps there is some trick that I don’t know of.

  • 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-26T23:10:56+00:00Added an answer on May 26, 2026 at 11:10 pm

    I think you can’t.

    Brendan Eich just confirmed that last night on his twitter, in a conversation with dhh.

    Reproducing here:

    @dhh: Is there any continued reason why JavaScript can’t access HTTP headers in the browser outside of Ajax? And what’s the historic reason?

    @BrendanEich: @dhh @lostconvos no good reason — I had no time in the old days (apart from document.cookie and navigator.userAgent), no one followed up.

    @dhh: Could we just borrow the API from xhr: getResponseHeader() and getAllResponseHeaders()?

    I suggest you follow both in case you are interested on this matter.

    In the meantime, I think the best you can do is having two different javascripts – one for POST pages and another one for the rest. You give both to your providers and tell them how to use them. But yes, this involves cooperation from the servers.

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

Sidebar

Related Questions

Possible Duplicate: Logging Clientside JavaScript Errors on Server How can I log client side
Possible Duplicate: HTML Compress File Upload? I have complains from client that my website
Possible Duplicate: Very large HTTP request vs many small requests I need a 2D
Possible Duplicate: A potentially dangerous Request.Form value was detected from the client A potentially
Possible Duplicate: Get Client IP using just Javascript? I know PhP can know your
Possible Duplicate: How can I downgrade the version of an SVN working copy? http://subversion.tigris.org/faq.html#working-copy-format-change
Possible Duplicate: What C++ library should I use to implement a HTTP client? What
Possible Duplicate: jqgrid client side sorting with server side paging - data disappears I'm
Possible Duplicate: What client-side situations need bind()? I saw the server program binding to
Possible Duplicate: How to profile and and get Javascript performance I have a page

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.