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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:48:49+00:00 2026-06-12T18:48:49+00:00

I have been working on a Mac App, and I am trying to make

  • 0

I have been working on a Mac App, and I am trying to make an Get HTTP request from github API, how ever this request is a conditional request and it looks something like this:

https://api.github.com/repos/soviettoly/sandbox/events -H "If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT"

When I do a curl -i on that request I get everything I want. However, I have been trying to this in XCode and I get a 404 back from github.

This is how I am making the request:

NSMutableString * theURL = [[NSMutableString alloc]initWithString:@"https://api.github.com/repos/soviettoly/sandbox/events -H \"If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT\""];

NSLog(@"the normal %@",theURL);
NSString * escaped = [theURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"the escpaed %@", escaped);
NSURL * test = [NSURL URLWithString: escaped];
NSLog(@"actual URL %@",test);
NSURLRequest * request = [NSURLRequest requestWithURL:test];
[[NSURLConnection alloc]initWithRequest:request delegate:self];

The print out from the NSLog commands give me this:

the normal https://api.github.com/repos/soviettoly/sandbox/events -H "If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT"
the escpaed https://api.github.com/repos/soviettoly/sandbox/events%20-H%20%22If-Modified-Since:%20Sat,%2013%20Oct%202012%2023:35:10%20GMT%22
actual URL https://api.github.com/repos/soviettoly/sandbox/events%20-H%20%22If-Modified-Since:%20Sat,%2013%20Oct%202012%2023:35:10%20GMT%22

I am not sure why the curl command gives me back the correct result while making a request in XCode does not. I have tried without doing the escaped characters but XCode does not like the URL since it contains ilegal characters. I am not sure how to make this kind of call in XCode. I been making other API calls for GitHub no problem, I am just having trouble with this one. If anyone can hep that would be great. Thanks alot!

  • 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-06-12T18:48:50+00:00Added an answer on June 12, 2026 at 6:48 pm

    Presumably, the curl command you’re using is

    curl https://api.github.com/repos/soviettoly/sandbox/events -H "If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT"
    

    That is not requesting the page ‘https://api.github.com/repos/soviettoly/sandbox/events -H “If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT”‘, it is requesting the page ‘ https://api.github.com/repos/soviettoly/sandbox/events‘, and sending an additional HTTP header (-H) that contains “If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT”.

    Your objective-c code is requesting the page ‘https://api.github.com/repos/soviettoly/sandbox/events -H ” If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT”‘. You need to use an NSMutableURLRequest and set it to include the header If-Modified-Since: Sat, 13 Oct 2012 23:35:10 GMT in a request to https://api.github.com/repos/soviettoly/sandbox/events.

    e.g.

    NSURL *url = [NSURL URLWithString:@"http://api.github.com/repos/soviettoly/sandbox/events"];
    NSMutableURLRequest *request = [NSMutableURLRequest requestForURL:url];
    [request setValue:@"Sat, 13 Oct 2012 23:35:10 GMT" forHTTPHeaderField:@"If-Modified-Since"];
    NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
    [connection start];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on this app for at least 3-4 months and just
I have been trying to get Google Chrome (6.0.401.1 dev) on Mac OS X
Site: http://clientfiles.priworks.com/lgmanagedportfolios/test/investment.html I have been working at this web page for a while now
Have been working on this question for a couple hours and have come close
I have been working on this sort of ATM (With a maximum of 50
I'm trying to user NSJSONSerialization in a mac app, but i can't get it
I have been extracting information from the iTunes App Store for the past couple
Hi i have been working through my first android app and it's starting to
I have a Mac App that's been in the app store for a year
Ok, I've been working with people on this code, and they have with some

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.