Skip to content

Commit

Permalink
Add support for a specific DownloadHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
jdnichollsc committed Aug 23, 2018
1 parent 40f789a commit 3fc69fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Proyecto26.RestClient/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("2.0.1")]
[assembly: AssemblyVersion ("2.1.0")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
4 changes: 2 additions & 2 deletions src/Proyecto26.RestClient/Proyecto26.RestClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Proyecto26.RestClient</id>
<version>2.0.1</version>
<version>2.1.0</version>
<title>RestClient for Unity</title>
<authors>Juan David Nicholls Cardona</authors>
<owners>jdnichollsc</owners>
Expand All @@ -12,7 +12,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Simple HTTP and REST client for Unity based on Promises, also support Callbacks!</description>
<releaseNotes>Add more HTTP methods, handle exceptions and support more options</releaseNotes>
<copyright>Copyright ©2017 Proyecto 26</copyright>
<copyright>Copyright ©2018 Proyecto 26</copyright>
<tags>Unity Promises Http Rest http-client HttpClient rest-client RestClient Request</tags>
<dependencies>
<dependency id="RSG.Promise" version="3.0.1" />
Expand Down
5 changes: 4 additions & 1 deletion src/Proyecto26.RestClient/Utils/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public static IEnumerator SendWebRequest(this UnityWebRequest request, RequestHe
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
request.uploadHandler.contentType = contentType;
}
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
if (options.DownloadHandler is DownloadHandler)
request.downloadHandler = options.DownloadHandler;
else
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", contentType);
foreach (var header in RestClient.DefaultRequestHeaders)
{
Expand Down
7 changes: 7 additions & 0 deletions src/Proyecto26.RestClient/Utils/RequestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ public List<IMultipartFormSection> FormSections
set { _formSections = value; }
}

private DownloadHandler _downloadHandler;
public DownloadHandler DownloadHandler
{
get { return _downloadHandler; }
set { _downloadHandler = value; }
}

private Dictionary<string, string> _headers;
public Dictionary<string, string> Headers
{
Expand Down

0 comments on commit 3fc69fa

Please sign in to comment.