@@ -159,7 +159,11 @@ private async Task<string> DoGetRequestAsync(string url, string expectedContentT
159159 _httpClient . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( expectedContentType ) ) ;
160160
161161 // Sign request object
162- await SecuredClient . SignRequest ( _httpClient , HttpMethod . Get , url , new StringContent ( string . Empty ) , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
162+ var reqMessage = new HttpRequestMessage ( HttpMethod . Get , url )
163+ {
164+ Content = new StringContent ( string . Empty )
165+ } ;
166+ await SecuredClient . SignRequest ( _httpClient , reqMessage , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
163167
164168 // Send HTTP request and retrieve response
165169 // TODO exception handling
@@ -182,7 +186,11 @@ private async Task<string> DoPostRequestAsync(string url, string body, string bo
182186 {
183187 // Sign request object
184188 var encodedBody = new StringContent ( body , Encoding . UTF8 , bodyContentType ) ;
185- await SecuredClient . SignRequest ( _httpClient , HttpMethod . Post , url , encodedBody , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
189+ var reqMessage = new HttpRequestMessage ( HttpMethod . Post , url )
190+ {
191+ Content = encodedBody
192+ } ;
193+ await SecuredClient . SignRequest ( _httpClient , reqMessage , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
186194
187195 // Send HTTP request and retrieve response
188196 // TODO exception handling
@@ -201,7 +209,11 @@ private async Task<string> DoPutRequestAsync(string url, string body, string bod
201209 {
202210 // Sign request object
203211 var encodedBody = new StringContent ( body , Encoding . UTF8 , bodyContentType ) ;
204- await SecuredClient . SignRequest ( _httpClient , HttpMethod . Put , url , encodedBody , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
212+ var reqMessage = new HttpRequestMessage ( HttpMethod . Put , url )
213+ {
214+ Content = encodedBody
215+ } ;
216+ await SecuredClient . SignRequest ( _httpClient , reqMessage , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
205217
206218 // Send HTTP request and retrieve response
207219 // TODO exception handling
@@ -217,7 +229,11 @@ private async Task<string> DoPutRequestAsync(string url, string body, string bod
217229 private async Task < string > DoDeleteRequestAsync ( string url )
218230 {
219231 // Sign request object
220- await SecuredClient . SignRequest ( _httpClient , HttpMethod . Delete , url , new StringContent ( string . Empty ) , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
232+ var reqMessage = new HttpRequestMessage ( HttpMethod . Delete , url )
233+ {
234+ Content = new StringContent ( string . Empty )
235+ } ;
236+ await SecuredClient . SignRequest ( _httpClient , reqMessage , _consumerKey , _sharedSecret , SignatureMethod . HmacSha1 ) ;
221237
222238 // Send HTTP request and retrieve response
223239 // TODO exception handling
0 commit comments