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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:45:19+00:00 2026-05-23T16:45:19+00:00

I am using ASIHTTPRequest to contact an API the problem is that it is

  • 0

I am using ASIHTTPRequest to contact an API the problem is that it is returning html instead of JSON and i have no idea why. Everything has been working great for weeks and i can’t seem to figure out what has broken..

What’s strange is doing exactly the same request with a browser or postie returns the correct JSON response, but when i do the request via ASIHTTPRequest these are the response headers i get:

"Cache-Control" = "private, max-age=0, must-revalidate";
    Connection = "keep-alive";
    "Content-Encoding" = gzip;
    "Content-Type" = "text/html; charset=utf-8";
    Date = "Tue, 05 Jul 2011 21:11:10 GMT";
    Etag = "\"e467792713ac4124f055c1719f4ea6c2\"";
    Server = "nginx/0.7.65";
    Status = "200 OK";
    "Transfer-Encoding" = Identity;
    "X-Runtime" = 1;

And the html (which should be json)..

<div id="universal_meta" logged_in_user_id="removed" style="display:none"></div>
<div id="meta" screen="projects" logged_in_as="removed"></div>
<h1>9 projects with 50 open issues</h1>
<ul class="biglinks progressbars">
 etc...

Here is the code used to do the request..

NSURL *url = [NSURL URLWithString:path];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];

if(secure){
       [request setUsername:self.username];
       [request setPassword:self.password];
}

[request setDelegate:self];
[request setDidFinishSelector:@selector(requestDone:)];
[request setDidFailSelector:@selector(requestWentWrong:)];
[request setDownloadDestinationPath:destination];

[[self queue] addOperation:request]; //queue is an NSOperationQueue

I have triple checked all of the login details/url, everything is correct, i would really appreciate any help with this one as i am completely lost.

—

Update:

Lighthouse have acknowledged a bug regarding headers on their side. Waiting on a solution from them.

  • 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-23T16:45:20+00:00Added an answer on May 23, 2026 at 4:45 pm

    Did you check that the headers sent using your browser are also the same as when you send the request by code?

    Especially did you try to add the “Accept” header to your request to define that you accept the json Content-Type?

    [request addRequestHeader:@"Accept" value:@"application/json"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using ASIHTTPRequest to do a simple POST upload of a Scores
I have been using ASIHTTPRequest for quite a while now and i quite satisfied
I'm using ASIHTTPRequest API to get some JSON data from a web side. I'm
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
I am using ASIHTTPREQUEST in an iPhone project to get some data that looks
I am using ASIHTTPRequest, and i have to make use of the POST method
I'm using ASIHTTPRequest to pull the JSON data from WCF. I then looping through
I have set up a sharedCache using ASIHttprequest and it is created from the
I have an iphone app using ASIHttpRequest. The server code is on heroku in

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.