• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Headers and AJAX?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Headers and AJAX?


  • Subject: Headers and AJAX?
  • From: Jesse Tayler via Webobjects-dev <email@hidden>
  • Date: Sat, 3 Oct 2020 08:18:57 -0400

I have relied on passing auth keys in headers from mobile apps and scripts.

I can even stuff a header into a curl statement

        curl -H "Authorization: MY_PRIVATE_KEY"

In WO I can simply ask

        request().headerForKey("Authorization”);

And I get that key,  always works as I’d expect

now I’m testing some AJAX and I see a few things

1. It makes my header lowercase?
2. I can print out all headers and all keys from WO and I can see my header
listed but I’m never able to read it? Even if I use lowercase or change keys I
never get a header in WO when I send it from AJAX

How could this be?

Is this some OTHER form of header or something?


I try a few ways to insert headers all to the same effect



        beforeSend: function (xhr) {
            xhr.setRequestHeader ("Authorization", "MY_PRIVATE_KEY”);
        },




Or--



        headers: {
                 "Authorization": "MY_PRIVATE_KEY”,
                "my-second-header": "second value”
        },


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Headers and AJAX?
      • From: Samuel Pelletier via Webobjects-dev <email@hidden>
  • Prev by Date: You may not want to upgrade Eclipse to 2020-09
  • Next by Date: Re: Headers and AJAX?
  • Previous by thread: You may not want to upgrade Eclipse to 2020-09
  • Next by thread: Re: Headers and AJAX?
  • Index(es):
    • Date
    • Thread