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 3450826
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:05:14+00:00 2026-05-18T09:05:14+00:00

I’m building a RESTful API for a personal project and the administrative area uses

  • 0

I’m building a RESTful API for a personal project and the administrative area uses Ext. Since the API requires a token to be passed back and forth via the custom header ‘X-API-Auth’, I need to be able to add that to every Ajax request made by Ext.

For instance, in the user management area, I have a GridPanel, using a JsonStore, display a list of registered users. The ‘autoLoad’ property is set to TRUE. This way, when you first visit the screen, the GridPanel is automatically populated.

Before anything is rendered, I include the following headers:

Ext.Ajax.defaultHeaders = {
    'X-API-Auth' : __API_KEY,
    'Accept' : 'application/json'
};

Where ‘__API_KEY’ is the token.

Now, my understanding is that these custom headers should now be sent with every Ajax call. When I first visit the member list page, I get a 403 Forbidden response thrown from the API. This is because the initial Ajax call the GridPanel makes is not sending the required headers. The API is functioning properly since, without the headers, it cannot authenticate the request.

Now, if I click the ‘reload’ button within the included PagingToolbar component associated with the GridPanel’s JsonStore, it DOES send the headers. All Ajax calls to the member listing endpoint invoked manually yield the desired result.

Is there a reason why ‘autoLoad’ on a Store does not respect the ‘defaultHeaders’ property? If anyone can shed some light on this it would be greatly appreciated. I also asked this on the Sencha forums and noone seems to have an answer.

Thanks!

  • 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-18T09:05:15+00:00Added an answer on May 18, 2026 at 9:05 am

    Alright, all that writing was for not. I messed up the order of operation. All these JavaScript files were being created by Ext Designer. I thought I was placing the ‘defaultHeaders’ property at the top of the path of execution, but it turns out I was wrong.

    All fixed.

    I’m going to go cut myself now.

    /forever alone

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

Sidebar

Related Questions

No related questions found

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.