Google API V3:videosInsertRequest.UploadAsync返回“响应状态代码不表示成功:400(错误请求)"; [英] Google API V3: videosInsertRequest.UploadAsync returns "Response status code does not indicate success: 400 (Bad Request)"

查看:169
本文介绍了Google API V3:videosInsertRequest.UploadAsync返回“响应状态代码不表示成功:400(错误请求)";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上周五,在我的EXE中执行 videosInsertRequest.UploadAsync 正常.今天,星期一,通过Response_Received事件处理程序返回了两个异常:响应状态代码不表示成功:400(错误请求).,后跟值不能为null.参数名称:baseUri .

Last Friday, execution of videosInsertRequest.UploadAsync in my EXE worked fine. Today, Monday, two exceptions are returned via the Response_Received event handler: Response status code does not indicate success: 400 (Bad Request). followed by Value cannot be null. Parameter name: baseUri.

执行 GoogleWebAuthorizationBroker.AuthorizeAsync,ChannelsResource.ListRequest,VideoCategoriesResource.ListRequest 仍然可以正常工作.

Execution of GoogleWebAuthorizationBroker.AuthorizeAsync, ChannelsResource.ListRequest, VideoCategoriesResource.ListRequest continue to work fine.

该程序的代码在周末没有更改.

There has been no change in the program's code over the weekend.

有什么想法吗?

NuGet软件包版本:

NuGet package versions:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Google.Apis" version="1.8.2" targetFramework="net40" />
  <package id="Google.Apis.Auth" version="1.8.2" targetFramework="net40" />
  <package id="Google.Apis.Core" version="1.8.2" targetFramework="net40" />
  <package id="Google.Apis.YouTube.v3" version="1.8.1.1080" targetFramework="net40" />
  <package id="log4net" version="2.0.3" targetFramework="net40" />
  <package id="Microsoft.Bcl" version="1.1.9" targetFramework="net40" />
  <package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
  <package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
  <package id="Microsoft.Net.Http" version="2.2.22" targetFramework="net40" />
  <package id="Newtonsoft.Json" version="6.0.3" targetFramework="net40" />
  <package id="Zlib.Portable" version="1.10.0" targetFramework="net40" />
</packages

推荐答案

此问题是由我的错误引起的.对错警报我感到抱歉.

This problem was caused by my error. I am sorry for the false alarm.

我已经使用程序的Google API V2版本在数据库中将视频排队.该程序的版本与API V3版本不同,将CategoryId存储在我的数据库中.

I had queued a video in my database using the Google API V2 version of my program. That version of the program stored the CategoryId in my database differently than the API V3 version.

我希望能够报告返回的实际错误( InvalidCategoryId ),但无法找到可以使用.NET客户端库检索到的错误.

I would like to be able to report the actual error returned (InvalidCategoryId) but have been unable to find where I can retrieve that using the .NET Client library.

来自Fiddler:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.video",
    "reason": "invalidCategoryId",
    "message": "Bad Request",
    "locationType": "other",
    "location": "body.snippet.categoryId"
   }
  ],
  "code": 400,
  "message": "Bad Request"
 }
}

这篇关于Google API V3:videosInsertRequest.UploadAsync返回“响应状态代码不表示成功:400(错误请求)";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆