Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. curl -i 'http://developer.echonest.com/api/v4/artist/profile?api_key=FILDTEOIK2HBORODV&name=weezer'
  2.  
  3. HTTP/1.1 200 OK
  4. Content-Length: 135
  5. X-RateLimit-Limit: 120
  6. X-RateLimit-Remaining: 62
  7. X-RateLimit-Used: 58
  8.  
  9. string baseurl = "http://developer.echonest.com/api/v4/artist/profile?api_key=GM5C44WAJ08RK7HSF&name=weezer";
  10. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseurl);
  11. request.Method = "POST";
  12. request.Accept = "application/json";
  13. request.UserAgent = "curl/7.37.0";
  14. request.ContentType = "application/x-www-form-urlencoded";
  15.  
  16. using (var streamWriter = new StreamWriter(request.GetRequestStream()))
  17. {
  18. string data = "browser=Win7x64-C1|Chrome32|1024x768&url=http://www.google.com";
  19. streamWriter.Write(data);
  20. }
  21.  
  22. var response = request.GetResponse();
  23. string text;
  24.  
  25. using (var sr = new StreamReader(response.GetResponseStream()))
  26. {
  27. text = sr.ReadToEnd();
  28. Console.WriteLine(text);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement