Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Body attribute missing in multipart #139

Closed
sridharAJ opened this issue Feb 8, 2014 · 4 comments
Closed

Error: Body attribute missing in multipart #139

sridharAJ opened this issue Feb 8, 2014 · 4 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@sridharAJ
Copy link

i am using drive version2 to insert a new file to google-drive.
To insert a new file to a google drive using client.files.insert() function

i am getting the following error:

Error: Body attribute missing in multipart.

var auth = new googleapis.OAuth2Client();

auth.setCredentials({
  access_token: 'accesskey'
});

googleapis.discover('drive', 'v2').execute(function(err, client) {
      client.drive.files.insert({ title: 'Test', mimeType: 'application/json' })
    .withMedia('application/json', "Hello world")
    .withAuthClient(auth)
    .execute(function(error,result){
      if(error){
        console.log(error);
      }else{
        console.log(result);
      }
    });

what is problem 20days back the above code is worked for me.but now its not.
is there any update happened in gopogleapis module or requestjs?

@sridharAJ
Copy link
Author

the above error is comes when the automatic refresh the access_token option is enable.
when the time of making request one more time the problem is occurs....
so if the access_token is not expired the its working fine...

pls fix this bug...

@sridharAJ sridharAJ reopened this Mar 31, 2014
@axelhzf
Copy link

axelhzf commented Jun 10, 2014

I'm having the same problem.

My temporal fix is to call auth.refreshAccessToken manually before the insert call.

@sridharAJ
Copy link
Author

yeah i also did the same thing...

@ryanseys
Copy link
Contributor

Just released 1.0.3 which addresses this issue. The access token will be refreshed prior to initial request if has expired or is missing and you have a refresh token set. If the request fails due to a missing, invalid, or revoked access token, we will no longer attempt to refresh and re-attempt the request, which is why you're seeing this issue.

https://github.com/google/google-api-nodejs-client/releases/tag/1.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants