Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim Post As System.Net.WebRequest = System.Net.WebRequest.Create("http://gdata.youtube.com/feeds/api/videos/IkkDV6_YEMQ/comments HTTP/1.1")
- Post.Method = "POST"
- Post.ContentType = "application/atom+xml"
- Post.Headers("Authorization") = "AuthSub token=""2FsdGE1VMjVB4OGFOAHGPJIwqzzE_T1flswzxpNLWjJDF90RDknAdJa_sgfheVM0XT"""
- Post.Headers("GData-Version") = "2"
- Post.Headers("X-GData-Key") = "key=Key"
- Post.ContentLength = MessageText.TextLength
- Dim newStream As Stream = Post.GetRequestStream()
- newStream.Write(Encoding.ASCII.GetBytes(MessageText.Text), 0, MessageText.TextLength)
- Console.WriteLine("The value of 'ContentLength' property after sending the data is {0}", Post.ContentLength)
- Dim response As HttpWebResponse = CType(Post.GetResponse(), HttpWebResponse)
- Console.WriteLine("Content length is {0}", response.ContentLength)
- Console.WriteLine("Content type is {0}", response.ContentType)
- ' Get the stream associated with the response.
- Dim receiveStream As Stream = response.GetResponseStream()
- ' Pipes the stream to a higher level stream reader with the required encoding format.
- Dim readStream As New StreamReader(receiveStream, Encoding.UTF8)
- Console.WriteLine("Response stream received.")
- Console.WriteLine(readStream.ReadToEnd())
- response.Close()
- readStream.Close()
- newStream.Close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement