환경 : ASP.NET 4.0 폼 윈도우 서버에서 실행중인 2008 비주얼 스튜디오 2010 얼티밋 DotNetOpenAuth (그냥 학습)숨겨진 비디오에 대한 메타 데이터를 얻기 [메오]
, 매우 간단 뭔가를 시도 작성 Vimeo를 호스트로 사용하는 비디오 아카이브이지만 우리는 Vimeo에서 웹 사이트에 삽입하기를 원합니다. 몇 가지 샘플 동영상을 업로드하고 Google 도메인에만 퍼가기를 숨기고 제한하도록 설정했습니다. 테스트 할 때 잘 삽입되지만 비디오 정보 (http://vimeo.com/api/v2/video/ * .xml)에 대한 요청을 보내면 서버가 404를 찾지 못합니다. 돌아가서 누구나 볼 수 있도록 설정하면 필요한 응답 정보를 얻을 수 있습니다. 비디오 정보를 얻고 비디오를 숨기려면 어떻게해야합니까?
private string GetVideoXML(string id)
{
try
{
// URL
String url = string.Format("http://vimeo.com/api/v2/video/{0}.xml", id);
// Make the request
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
string token = "<My authorization token from Vimeo API>";
request.Headers.Add("Authorization", "Basic " + token);
// Show me the money?
WebResponse response = request.GetResponse(); // Throws an exception, 404 not found
// Read XML
StreamReader reader = new StreamReader(response.GetResponseStream());
String responseData = reader.ReadToEnd();
//Close
reader.Close();
response.Close();
// Show me the money!
return responseData;
}
catch (Exception ex)
{
// You has some 'splaining to do
litError.Text = ex.ToString();
}
}