line21c / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

Request.ExecuteRequest throws NullReferenceException when no Authenticator is provided #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following line in Google.Apis.Requests.Request throws a 
NullReferenceException if Authenticator is null:

HttpWebRequest request = 
this.Authenticator.CreateHttpWebRequest(this.Method.HttpMethod, RequestUrl);

This prevents developers to use APIs that don't require authentication, as in 
the following snippet:

Request request = Request.CreateRequest(service, method);
var stream = request.WithParameters(requestParameters).ExecuteRequest()

Original issue reported on code.google.com by ccherub...@google.com on 31 Jan 2011 at 2:07

GoogleCodeExporter commented 9 years ago

Original comment by davidwat...@google.com on 31 Jan 2011 at 10:58

GoogleCodeExporter commented 9 years ago
Hi Claudio,
I have added the ability to not supply an Authenticator, I have also added to 
IRequest the method WithDeveloperApiKey(string).
This was added on branch issue_21_AddNullAuthenticatorSuppoort
I will ask paul to pull this change into default.

Original comment by davidwat...@google.com on 1 Feb 2011 at 1:12