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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:12:57+00:00 2026-05-24T22:12:57+00:00

I am trying to upload the document using Google API through my iPhone App.

  • 0

I am trying to upload the document using Google API through my iPhone App. Here is the code which I am using:

NSString *authorizationHeader = [NSString stringWithFormat:@"GoogleLogin auth=\"%@\"" ,[another  objectAtIndex:1]]; 
NSURL *url2 = [NSURL URLWithString:@"docs.google.com/feeds/documents/private/full"]; 
NSMutableURLRequest *urlRequest2 = [[NSMutableURLRequest alloc]initWithURL:url2];
[urlRequest2 setHTTPMethod:@"POST"]; 
[urlRequest2 setValue:@"2.0" forHTTPHeaderField:@"GData-Version"]; 
[urlRequest2 setValue:authorizationHeader forHTTPHeaderField:@"Authorization"];
[urlRequest2 setValue:Length forHTTPHeaderField:@"Content-Length"]; 
[urlRequest2 setValue:@"text/html" forHTTPHeaderField:@"Content-Type"]; 
[urlRequest2 setValue:slugStr forHTTPHeaderField:@"Slug"]; 
[urlRequest2 setHTTPBody:audioData];

Where authorizationHeader contains my GoogleLogin auth=theToken

By running this code I get the following response from the server

<HTML> 
<HEAD> <TITLE>Token invalid</TITLE>
</HEAD> 
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"> 
<H1>Token invalid</H1> 
<H2>Error 401</H2> 
</BODY> 
</HTML>

I don’t know where I am making the mistake. Is there an error in my header or am I passing the wrong parameters?

  • 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-24T22:12:58+00:00Added an answer on May 24, 2026 at 10:12 pm

    Shouldn’t the url in the is prefixed with http:// when creating the NSURL?

    NSURL *url2 = [NSURL URLWithString:@"http://docs.google.com/feeds/documents/private/full"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to upload an application to the iPhone App Store, but I get
I am trying to upload, download documents and spreadsheets using Google Documents List Data
Trying to upload a word document then attach it to an email which is
iam trying to show image preview before upload, for that i am using code
Trying to upload files using Google Gears and ASP.NET... I assume you can as
am currently using google feed api to get feed links dynamically. am trying to
I'm trying to upload documents to SharePoint using web services attaching custom metadata to
I'm trying to upload an image to my site through a form, however it's
I am trying to upload file using php. I am using the function move_uploaded_file.
I'm trying to upload a file using Watin and C#. Under Windows XP, Watin

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.