Skip to content

Commit

Permalink
Merge pull request speckleworks#87 from speckleworks/Dimitrie/dev/com…
Browse files Browse the repository at this point in the history
…pression

added headers, should fix speckleworks#86 🤞
  • Loading branch information
didimitrie authored Oct 25, 2018
2 parents d6c5028 + 4b4c91f commit 7885986
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 83 deletions.
71 changes: 36 additions & 35 deletions SpeckleCore/SpeckleApiClientApiCalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async System.Threading.Tasks.Task<ResponseUser> UserRegisterAsync( User b
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts/register" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -125,7 +125,7 @@ public async System.Threading.Tasks.Task<ResponseUser> UserLoginAsync( User body
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts/login" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -223,7 +223,7 @@ public async System.Threading.Tasks.Task<ResponseUser> UserSearchAsync( User use
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts/search" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -321,7 +321,7 @@ public async System.Threading.Tasks.Task<ResponseUser> UserGetAsync( System.Thre
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -416,7 +416,7 @@ public async System.Threading.Tasks.Task<ResponseBase> UserUpdateProfileAsync( U
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -518,7 +518,7 @@ public async System.Threading.Tasks.Task<ResponseUser> UserGetProfileByIdAsync(
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/accounts/{userId}" );
urlBuilder_.Replace( "{userId}", System.Uri.EscapeDataString( ConvertToString( userId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -613,7 +613,7 @@ public async System.Threading.Tasks.Task<ResponseClient> ClientGetAllAsync( Syst
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/clients" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -708,7 +708,7 @@ public async System.Threading.Tasks.Task<ResponseClient> ClientCreateAsync( AppC
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/clients" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -810,7 +810,7 @@ public async System.Threading.Tasks.Task<ResponseClient> ClientUpdateAsync( stri
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/clients/{clientId}" );
urlBuilder_.Replace( "{clientId}", System.Uri.EscapeDataString( ConvertToString( clientId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -912,7 +912,7 @@ public async System.Threading.Tasks.Task<ResponseClient> ClientGetAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/clients/{clientId}" );
urlBuilder_.Replace( "{clientId}", System.Uri.EscapeDataString( ConvertToString( clientId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1011,7 +1011,7 @@ public async System.Threading.Tasks.Task<ResponseBase> ClientDeleteAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/clients/{clientId}" );
urlBuilder_.Replace( "{clientId}", System.Uri.EscapeDataString( ConvertToString( clientId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1106,7 +1106,7 @@ public async System.Threading.Tasks.Task<ResponseProject> ProjectGetAllAsync( Sy
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/projects" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1201,7 +1201,7 @@ public async System.Threading.Tasks.Task<ResponseProject> ProjectCreateAsync( Pr
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/projects" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1303,7 +1303,7 @@ public async System.Threading.Tasks.Task<ResponseProject> ProjectUpdateAsync( st
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/projects/{projectId}" );
urlBuilder_.Replace( "{projectId}", System.Uri.EscapeDataString( ConvertToString( projectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1405,7 +1405,7 @@ public async System.Threading.Tasks.Task<ResponseProject> ProjectGetAsync( strin
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/projects/{projectId}" );
urlBuilder_.Replace( "{projectId}", System.Uri.EscapeDataString( ConvertToString( projectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1504,7 +1504,7 @@ public async System.Threading.Tasks.Task<ResponseBase> ProjectDeleteAsync( strin
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/projects/{projectId}" );
urlBuilder_.Replace( "{projectId}", System.Uri.EscapeDataString( ConvertToString( projectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1611,7 +1611,7 @@ public async System.Threading.Tasks.Task<ResponseComment> CommentCreateAsync( Re
urlBuilder_.Replace( "{resourceType}", System.Uri.EscapeDataString( ConvertToString( resourceType, System.Globalization.CultureInfo.InvariantCulture ) ) );
urlBuilder_.Replace( "{resourceId}", System.Uri.EscapeDataString( ConvertToString( resourceId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1721,7 +1721,7 @@ public async System.Threading.Tasks.Task<ResponseComment> CommentGetFromResource
urlBuilder_.Replace( "{resourceType}", System.Uri.EscapeDataString( ConvertToString( resourceType, System.Globalization.CultureInfo.InvariantCulture ) ) );
urlBuilder_.Replace( "{resourceId}", System.Uri.EscapeDataString( ConvertToString( resourceId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1820,7 +1820,7 @@ public async System.Threading.Tasks.Task<ResponseComment> CommentGetAsync( strin
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/comments/{commentId}" );
urlBuilder_.Replace( "{commentId}", System.Uri.EscapeDataString( ConvertToString( commentId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -1919,7 +1919,7 @@ public async System.Threading.Tasks.Task<ResponseBase> CommentUpdateAsync( strin
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/comments/{commentId}" );
urlBuilder_.Replace( "{commentId}", System.Uri.EscapeDataString( ConvertToString( commentId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2021,7 +2021,7 @@ public async System.Threading.Tasks.Task<ResponseBase> CommentDeleteAsync( strin
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/comments/{commentId}" );
urlBuilder_.Replace( "{commentId}", System.Uri.EscapeDataString( ConvertToString( commentId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2116,7 +2116,8 @@ public async System.Threading.Tasks.Task<ResponseStream> StreamsGetAllAsync( Sys
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/streams" );

var client_ = new System.Net.Http.HttpClient();
//var client_ = GetHttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2211,7 +2212,7 @@ public async System.Threading.Tasks.Task<ResponseStream> StreamCreateAsync( Spec
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/streams" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2316,7 +2317,7 @@ public async System.Threading.Tasks.Task<ResponseStream> StreamGetAsync( string
urlBuilder_.Replace( "{streamId}", System.Uri.EscapeDataString( ConvertToString( streamId, System.Globalization.CultureInfo.InvariantCulture ) ) );
if ( query != null ) urlBuilder_.Append( query );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2415,7 +2416,7 @@ public async System.Threading.Tasks.Task<ResponseBase> StreamUpdateAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/streams/{streamId}" );
urlBuilder_.Replace( "{streamId}", System.Uri.EscapeDataString( ConvertToString( streamId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2517,7 +2518,7 @@ public async System.Threading.Tasks.Task<ResponseBase> StreamDeleteAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/streams/{streamId}" );
urlBuilder_.Replace( "{streamId}", System.Uri.EscapeDataString( ConvertToString( streamId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2620,7 +2621,7 @@ public async System.Threading.Tasks.Task<ResponseObject> StreamGetObjectsAsync(
if ( query != null ) urlBuilder_.Append( query );


var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2719,7 +2720,7 @@ public async System.Threading.Tasks.Task<ResponseStreamClone> StreamCloneAsync(
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/streams/{streamId}/clone" );
urlBuilder_.Replace( "{streamId}", System.Uri.EscapeDataString( ConvertToString( streamId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2822,7 +2823,7 @@ public async System.Threading.Tasks.Task<ResponseStreamDiff> StreamDiffAsync( st
urlBuilder_.Replace( "{streamId}", System.Uri.EscapeDataString( ConvertToString( streamId, System.Globalization.CultureInfo.InvariantCulture ) ) );
urlBuilder_.Replace( "{otherStreamId}", System.Uri.EscapeDataString( ConvertToString( otherStreamId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -2917,7 +2918,7 @@ public async System.Threading.Tasks.Task<ResponseObject> ObjectCreateAsync( Syst
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/objects" );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -3019,7 +3020,7 @@ public async System.Threading.Tasks.Task<ResponseObject> ObjectUpdateAsync( stri
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/objects/{objectId}" );
urlBuilder_.Replace( "{objectId}", System.Uri.EscapeDataString( ConvertToString( objectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -3121,7 +3122,7 @@ public async System.Threading.Tasks.Task<ResponseObject> ObjectGetAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/objects/{objectId}" );
urlBuilder_.Replace( "{objectId}", System.Uri.EscapeDataString( ConvertToString( objectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -3220,7 +3221,7 @@ public async System.Threading.Tasks.Task<ResponseBase> ObjectDeleteAsync( string
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/objects/{objectId}" );
urlBuilder_.Replace( "{objectId}", System.Uri.EscapeDataString( ConvertToString( objectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -3321,7 +3322,7 @@ public async System.Threading.Tasks.Task<ResponseBase> ObjectUpdatePropertiesAsy
urlBuilder_.Append( BaseUrl != null ? BaseUrl.TrimEnd( '/' ) : "" ).Append( "/objects/{objectId}/properties" );
urlBuilder_.Replace( "{objectId}", System.Uri.EscapeDataString( ConvertToString( objectId, System.Globalization.CultureInfo.InvariantCulture ) ) );

var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down Expand Up @@ -3408,7 +3409,7 @@ public async System.Threading.Tasks.Task<ResponseObject> ObjectGetBulkAsync( str
if ( query != null ) urlBuilder_.Append( query );


var client_ = new System.Net.Http.HttpClient();
var client_ = GetHttpClient();
try
{
using ( var request_ = new System.Net.Http.HttpRequestMessage() )
Expand Down
Loading

0 comments on commit 7885986

Please sign in to comment.