Skip to content

Commit

Permalink
Removed Header overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny @PC committed Feb 21, 2015
1 parent 1f359df commit bf0db02
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SpotifyAPI/SpotifyWebAPI/SpotifyWebAPIClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ public T UploadData<T>(String url, String uploadData, String method = "POST")
{
if (!UseAuth)
throw new Exception("UseAuth required for 'UploadData'");
webclient.Headers.Add("Authorization", TokenType + " " + AccessToken);
webclient.Headers.Add("Content-Type", "application/json");
webclient.Headers.Set("Authorization", TokenType + " " + AccessToken);
webclient.Headers.Set("Content-Type", "application/json");
String response = "";
try
{
Expand All @@ -367,7 +367,9 @@ public T DownloadData<T>(String url)
public String DownloadString(String url)
{
if (UseAuth)
webclient.Headers.Add("Authorization", TokenType + " " + AccessToken);
webclient.Headers.Set("Authorization", TokenType + " " + AccessToken);
else if (!UseAuth && webclient.Headers["Authorization"] != null)
webclient.Headers.Remove("Authorization");
String response = "";
try
{
Expand Down

0 comments on commit bf0db02

Please sign in to comment.