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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:34:32+00:00 2026-05-24T19:34:32+00:00

I have inherited some code that will eventually be part of an API call.

  • 0

I have inherited some code that will eventually be part of an API call. Based on the existing code, the call is a post to retrieve JSON code with an access_token. While this would normally be simple and like every other API out there, this code requires that there be a customized httpheader field for the client secret.

I was able to make this work in Objective C with URLRequest, etc. but now that I am creating the call for a web component, I have been roadblocked.

I am using a pretty standard jquery post

        $.post('https://url.com', 
        {access_token:'XXXXXXXXXXXXXXXXXXX',
         function(data){
           console.info(data);
         }, 'json');

With a HTTP-EQUIV in the header. But the post never retrieves data and the server itself doesn’t recognized that any call was made (even an incomplete one).

I may have to scrap this code and start over, but if anyone has encountered this problem before, please offer any insight.

  • 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-24T19:34:33+00:00Added an answer on May 24, 2026 at 7:34 pm

    What you posted has a syntax error, but it makes no difference as you cannot pass HTTP headers via $.post().

    Provided you’re on jQuery version >= 1.5, switch to $.ajax() and pass the headers (docs) option. (If you’re on an older version of jQuery, I will show you how to do it via the beforeSend option.)

    $.ajax({
        url: 'https://url.com',
        type: 'post',
        data: {
            access_token: 'XXXXXXXXXXXXXXXXXXX'
        },
        headers: {
            Header_Name_One: 'Header Value One',   //If your header name has spaces or any other char not appropriate
            "Header Name Two": 'Header Value Two'  //for object property name, use quoted notation shown in second
        },
        dataType: 'json',
        success: function (data) {
            console.info(data);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited some really old VC6.0 code that I am upgrading to VS2008
I have inherited some code that uses klass instead of PyDev's preferred cls: def
I have inherited some legacy PHP code what was written back when it was
I have some C# / asp.net code I inherited which has a textbox which
I have inherited a very old database that needs some data to be updated.
I have inherited a project that has class libraries written in VB.NET, some of
Unfortunately I inherited some code (c/c++) that does some string manipulation and now I
I've inherited some windows-mobile code that I've been bringing up-to-date. I've come across a
I have inherited a middle tier system with some multi-Threading issues. Two different threads,
I have inherited a visual studio 2003 project which uses some custom build steps.

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.