sendgrid / csharp-http-client Goto Github PK
View Code? Open in Web Editor NEWTwilio SendGrid's C# HTTP Client for calling APIs
Home Page: https://sendgrid.com
License: MIT License
Twilio SendGrid's C# HTTP Client for calling APIs
Home Page: https://sendgrid.com
License: MIT License
Client
has a private field, _httpClient
which seems to only be used if BuildHttpClient
is called which I don't see called anywhere.
Is BuildHttpClient
supposed to be called?
Thanks.
Hello,
I can see the response from restful api for example in messagebox but a do not know have tu bing in datagridview.
How I can do it?
Thanks
catch (Exception ex) { HttpResponseMessage response = new HttpResponseMessage(); string message; message = (ex is HttpRequestException) ? ".NET HttpRequestException" : ".NET Exception"; message = message + ", raw message: \n\n"; response.Content = new StringContent(message + ex.Message); return new Response(response.StatusCode, response.Content, response.Headers); }
As you can see response always initializes with StatusCode.Ok.
It's not possible with such implementation to track when client throws something.
For every release, we hand craft the release notes on GitHub, now we would like to automate this process. Please see the existing release notes for an example. The contents of the release notes are generated from the CHANGELOG.md file. Here is the documentation for updating the release notes via the GitHub API.
When debugging, it can be useful to examine the request body before sending to the SendGrid API.
Prove an example of how to examine the request body in TROUBLESHOOTING.md. For an example, see here.
We would like to have a template for describing what has changed in the pull request being submitted.
You can use this file as an example
We received an awesome PR for #hacktoberfest on our ruby library
We would love to see the same thing on the README in this repo as well.
Please replace the "-" with "_" in README, CONTRIBUTING, USE_CASES, USAGE files.
Thanks and happy Hacktoberfest!!
2) Test Failure : UnitTest.TestClient.TestMethodCallWithCancellationToken
An unexpected exception type was thrown
Expected: System.Threading.Tasks.TaskCanceledException
but was: System.NullReferenceException : Object reference not set to an instance of an object
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinder.LookForCandidates () [0x00137] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinder.Bind (System.Boolean bReportErrors) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder.BindMethodGroupToArgumentsCore (Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinderResult& pResults, Microsoft.CSharp.RuntimeBinder.Semantics.BindingFlag bindFlags, Microsoft.CSharp.RuntimeBinder.Semantics.ExprMemberGroup grp, Microsoft.CSharp.RuntimeBinder.Semantics.Expr& args, System.Int32 carg, System.Boolean bindingCollectionAdd, System.Boolean bHasNamedArgumentSpecifiers) [0x00042] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder.BindMethodGroupToArguments (Microsoft.CSharp.RuntimeBinder.Semantics.BindingFlag bindFlags, Microsoft.CSharp.RuntimeBinder.Semantics.ExprMemberGroup grp, Microsoft.CSharp.RuntimeBinder.Semantics.Expr args) [0x00067] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCall (Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder payload, Microsoft.CSharp.RuntimeBinder.Semantics.Expr callingObject, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x00287] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.DispatchPayload (Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder payload, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x0000b] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.DispatchPayload (Microsoft.CSharp.RuntimeBinder.RuntimeBinder runtimeBinder, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore (Microsoft.CSharp.RuntimeBinder.ICSharpBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x0006e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind (System.Dynamic.DynamicMetaObjectBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x00021] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind (System.Dynamic.DynamicMetaObjectBinder action, Microsoft.CSharp.RuntimeBinder.RuntimeBinder binder, System.Dynamic.DynamicMetaObject[] args, System.Collections.Generic.IEnumerable`1[T] arginfos, System.Dynamic.DynamicMetaObject onBindingError) [0x001f5] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject errorSuggestion) [0x0000e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at System.Dynamic.InvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00000] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObject.BindInvokeMember (System.Dynamic.InvokeMemberBinder binder, System.Dynamic.DynamicMetaObject[] args) [0x0000b] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.InvokeMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00016] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x000f1] in <7c7d16af841f44d5a362340966c7fd69>:0
at UnitTest.TestClient+<TestMethodCallWithCancellationToken>d__3.MoveNext () [0x00113] in <c0a36338f0ee473a8317e17500d161f9>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9790d962aaad40deb63d33029ba0d2f6>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <9790d962aaad40deb63d33029ba0d2f6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperation.Invoke () [0x00001] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperationQueue.InvokePendingOperations () [0x00015] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperationQueue.InvokeAll () [0x00022] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext.WaitForPendingOperationsToComplete () [0x00001] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncInvocationRegion+AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete (System.Object invocationResult) [0x00002] in <746131cbfdc6477ab4c97256f2af20a6>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinder.LookForCandidates () [0x00137] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinder.Bind (System.Boolean bReportErrors) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder.BindMethodGroupToArgumentsCore (Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder+GroupToArgsBinderResult& pResults, Microsoft.CSharp.RuntimeBinder.Semantics.BindingFlag bindFlags, Microsoft.CSharp.RuntimeBinder.Semantics.ExprMemberGroup grp, Microsoft.CSharp.RuntimeBinder.Semantics.Expr& args, System.Int32 carg, System.Boolean bindingCollectionAdd, System.Boolean bHasNamedArgumentSpecifiers) [0x00042] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Semantics.ExpressionBinder.BindMethodGroupToArguments (Microsoft.CSharp.RuntimeBinder.Semantics.BindingFlag bindFlags, Microsoft.CSharp.RuntimeBinder.Semantics.ExprMemberGroup grp, Microsoft.CSharp.RuntimeBinder.Semantics.Expr args) [0x00067] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCall (Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder payload, Microsoft.CSharp.RuntimeBinder.Semantics.Expr callingObject, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x00287] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.DispatchPayload (Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder payload, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x0000b] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.DispatchPayload (Microsoft.CSharp.RuntimeBinder.RuntimeBinder runtimeBinder, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol[] locals) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore (Microsoft.CSharp.RuntimeBinder.ICSharpBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x0006e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind (System.Dynamic.DynamicMetaObjectBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x00021] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind (System.Dynamic.DynamicMetaObjectBinder action, Microsoft.CSharp.RuntimeBinder.RuntimeBinder binder, System.Dynamic.DynamicMetaObject[] args, System.Collections.Generic.IEnumerable`1[T] arginfos, System.Dynamic.DynamicMetaObject onBindingError) [0x001f5] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject errorSuggestion) [0x0000e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at System.Dynamic.InvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00000] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObject.BindInvokeMember (System.Dynamic.InvokeMemberBinder binder, System.Dynamic.DynamicMetaObject[] args) [0x0000b] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.InvokeMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00016] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x000f1] in <7c7d16af841f44d5a362340966c7fd69>:0
at UnitTest.TestClient+<TestMethodCallWithCancellationToken>d__3.MoveNext () [0x00113] in <c0a36338f0ee473a8317e17500d161f9>:0
--- End of stack trace from previous location where exception was thrown ---
at NUnit.Framework.AsyncInvocationRegion+AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete (System.Object invocationResult) [0x0001b] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Core.NUnitAsyncTestMethod.RunTestMethod () [0x00016] in <746131cbfdc6477ab4c97256f2af20a6>:0
It is really nice to be able to develop locally inside a docker container! Please dockerize this repo!
We are seeing
The command "mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe UnitTest/bin/Release/UnitTest.dll -domain:None" exited with 3.
On every build. Can you help with this?
Add a file to the root of this repo called CODE_OF_CONDUCT.md, with the content from the same file in our docs repo.
Our preference is that users have an environment file when using the SendGrid API, because it is less likely that someone would commit their credentials to github.
Please make a couple changes:
export SENDGRID_API_KEY=''
.env
Is there a specific reason why a new HttpClient is instantiated on each request which is made through this client?
Reusing a HttpClient instance is considered a best practice regarding to performance and memory pressure. I'm glad to do a pull request, but first wanted to verify there isn't a specific reason to not reuse the instance.
f.e. https://skimming.net/why-you-should-reuse-httpclient-instances/
We would like to get our English polished up throughout the repo.
Similar to what was done on the SendGrid node README:
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
For the following, make sure the correct repo is linked!
For email notifications, you can change the "nodejs" to the language of this repo (e.g. java, python, ruby, php, csharp, go, etc)
[![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-nodejs.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-nodejs)
[![Email Notifications Badge](https://dx.sendgrid.com/badge/nodejs)](https://dx.sendgrid.com/newsletter/nodejs)
[![npm](https://img.shields.io/npm/l/express.svg)]()
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-nodejs.svg)](https://github.com/sendgrid/sendgrid-nodejs/graphs/contributors)
Thank you and happy #Hacktoberfest!!
It isn't a bug per se but more of a feature. It would be nice to be able to add a parameter for the HTTP timeout so we can adjust to our needs.
Nothing to see here. Ignore this issue.
We want to update our git workflow to function more like Gitflow. We need to update the CONTRIBUTING.md file and PULL_REQUEST_TEMPLATE to direct contributors to fork/branch off the development
branch and to merge their PRs with the development
branch. Once this issue is complete, we will be creating the development
branch and making that branch the default. This is part of a larger strategy to execute releases for this SDK on a predictable cadence.
development
branch and submitting PRs agains the development
branch.The Travis tests are failing on the TestLicenseEndYear
test as it cannot find LICENSE.txt
System.IO.FileNotFoundException : Could not find file "/home/travis/build/sendgrid/csharp-http-client/LICENSE.txt"
The test is looking for the wrong file type for the license. The test needs updating to the .md
file extension.
I will raise a PR to fix this.
Usage files are really nice when they exist in a repo, because it makes it really obvious where to look for information about how to use this tool. It can be frustrating when you expect this file to be there and it's not.
Please add a USAGE.md file, you can see an example of this
here
Please make sure you modify the file for this repo (hint: Most of this information should be in the README file)
This license file might have the wrong end year (2017). If this is the case, please make a PR that updates the year. If the year is correct, please close this issue!
In the CONTRIBUTING.md
file there is a section on Style Guidelines & Naming Conventions. Please review and implement a check in Travis CI. If there are any style errors, either fix or create a rule to exclude the error.
Before writing any code, we suggest you review our CONTRIBUTING.md
file and propose your solution for discussion here in the comments. Thank you!
CONTRIBUTING.md
fileThe end year in the license file should be "this year" and this should be checked on every run of the tests. If the end year is no correct, fail the test.
example:
Copyright (c) 2012-2016 SendGrid, Inc.
It is 2017, so this should be:
Copyright (c) 2012-2017 SendGrid, Inc.
and the test should fail.
--done
HttpClient allows cancellation via CancellationToken. Using this API it is currently not possible to pass a cancellation token. Therefore you cannot cancel long running requests.
It would be helpful in our scenario to be able to cancel running requests. CancellationToken provides a standard way to do this and it should be easy to include this as an extra parameter. Please consider it for an upcoming release.
Thanks!
This repo should have the following list of files included:
This PR is only asking for tests of the existence of these files, if the files do not exist when you run the tests - do not worry about the tests not passing. We will identify this and create a new PR for the issue.
Thank you!
The role of Developer Experience Engineer just became available and we want to announce it in the README. Here is the copy:
If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, this is an incredible opportunity to join our #DX team as a Developer Experience Engineer and work with @thinkingserious and @aroach! Tell your friends :)
Due to the success we have seen from hacktoberfest, we are seeing more people create use cases. This is amazing!
We want to make sure that everyone can find them. Please help us to break up this file and make it easier to read and manage:
A fix for this thread: sendgrid/sendgrid-csharp#259 (comment)
It appears that this call to .Result is misplaced: https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L245
1) Test Error : UnitTest.TestClient.TestMethodCall
System.ArgumentOutOfRangeException : Length cannot be less than zero.
Parameter name: length
at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0004a] in <9790d962aaad40deb63d33029ba0d2f6>:0
at Microsoft.CSharp.RuntimeBinder.Syntax.NameTable.Add (System.String key, System.Int32 length) [0x00048] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Syntax.NameManager.Add (System.String key, System.Int32 length) [0x00010] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.GetName (System.Type type) [0x0002b] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.LoadSymbolsFromType (System.Type originalType) [0x0004e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.GetCTypeFromType (System.Type t) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddMethodToSymbolTable (System.Reflection.MemberInfo member, Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol callingAggregate, Microsoft.CSharp.RuntimeBinder.Semantics.MethodKindEnum kind) [0x001d1] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddNamesInInheritanceHierarchy (System.String name, System.Collections.Generic.List`1[T] inheritance) [0x0015d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddNamesOnType (Microsoft.CSharp.RuntimeBinder.SymbolTable+NameHashKey key) [0x0000d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.PopulateSymbolTableWithName (System.String name, System.Collections.Generic.IEnumerable`1[T] typeArguments, System.Type callingType) [0x00056] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.PopulateSymbolTableWithPayloadInformation (Microsoft.CSharp.RuntimeBinder.SymbolTable symbolTable, Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder callOrInvoke, System.Type callingType, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments) [0x00038] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.PopulateSymbolTableWithName (Microsoft.CSharp.RuntimeBinder.SymbolTable symbolTable, System.Type callingType, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore (Microsoft.CSharp.RuntimeBinder.ICSharpBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x0001d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind (System.Dynamic.DynamicMetaObjectBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x00021] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind (System.Dynamic.DynamicMetaObjectBinder action, Microsoft.CSharp.RuntimeBinder.RuntimeBinder binder, System.Dynamic.DynamicMetaObject[] args, System.Collections.Generic.IEnumerable`1[T] arginfos, System.Dynamic.DynamicMetaObject onBindingError) [0x001f5] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject errorSuggestion) [0x0000e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at System.Dynamic.InvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00000] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObject.BindInvokeMember (System.Dynamic.InvokeMemberBinder binder, System.Dynamic.DynamicMetaObject[] args) [0x0000b] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.InvokeMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00016] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x000f1] in <7c7d16af841f44d5a362340966c7fd69>:0
at UnitTest.TestClient+<TestMethodCall>d__2.MoveNext () [0x000f3] in <c0a36338f0ee473a8317e17500d161f9>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9790d962aaad40deb63d33029ba0d2f6>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <9790d962aaad40deb63d33029ba0d2f6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperation.Invoke () [0x00001] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperationQueue.InvokePendingOperations () [0x00015] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext+AsyncOperationQueue.InvokeAll () [0x00022] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncSynchronizationContext.WaitForPendingOperationsToComplete () [0x00001] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Framework.AsyncInvocationRegion+AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete (System.Object invocationResult) [0x00002] in <746131cbfdc6477ab4c97256f2af20a6>:0
at System.String.Substring (System.Int32 startIndex, System.Int32 length) [0x0004a] in <9790d962aaad40deb63d33029ba0d2f6>:0
at Microsoft.CSharp.RuntimeBinder.Syntax.NameTable.Add (System.String key, System.Int32 length) [0x00048] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.Syntax.NameManager.Add (System.String key, System.Int32 length) [0x00010] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.GetName (System.Type type) [0x0002b] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.LoadSymbolsFromType (System.Type originalType) [0x0004e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.GetCTypeFromType (System.Type t) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddMethodToSymbolTable (System.Reflection.MemberInfo member, Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol callingAggregate, Microsoft.CSharp.RuntimeBinder.Semantics.MethodKindEnum kind) [0x001d1] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddNamesInInheritanceHierarchy (System.String name, System.Collections.Generic.List`1[T] inheritance) [0x0015d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.AddNamesOnType (Microsoft.CSharp.RuntimeBinder.SymbolTable+NameHashKey key) [0x0000d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.SymbolTable.PopulateSymbolTableWithName (System.String name, System.Collections.Generic.IEnumerable`1[T] typeArguments, System.Type callingType) [0x00056] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.PopulateSymbolTableWithPayloadInformation (Microsoft.CSharp.RuntimeBinder.SymbolTable symbolTable, Microsoft.CSharp.RuntimeBinder.ICSharpInvokeOrInvokeMemberBinder callOrInvoke, System.Type callingType, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments) [0x00038] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.PopulateSymbolTableWithName (Microsoft.CSharp.RuntimeBinder.SymbolTable symbolTable, System.Type callingType, Microsoft.CSharp.RuntimeBinder.ArgumentObject[] arguments) [0x00000] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore (Microsoft.CSharp.RuntimeBinder.ICSharpBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x0001d] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind (System.Dynamic.DynamicMetaObjectBinder payload, System.Linq.Expressions.Expression[] parameters, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject& deferredBinding) [0x00021] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind (System.Dynamic.DynamicMetaObjectBinder action, Microsoft.CSharp.RuntimeBinder.RuntimeBinder binder, System.Dynamic.DynamicMetaObject[] args, System.Collections.Generic.IEnumerable`1[T] arginfos, System.Dynamic.DynamicMetaObject onBindingError) [0x001f5] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args, System.Dynamic.DynamicMetaObject errorSuggestion) [0x0000e] in <47daad7bf0954a69b4d1d95d4dc334d4>:0
at System.Dynamic.InvokeMemberBinder.FallbackInvokeMember (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00000] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObject.BindInvokeMember (System.Dynamic.InvokeMemberBinder binder, System.Dynamic.DynamicMetaObject[] args) [0x0000b] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.InvokeMemberBinder.Bind (System.Dynamic.DynamicMetaObject target, System.Dynamic.DynamicMetaObject[] args) [0x00016] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.DynamicMetaObjectBinder.Bind (System.Object[] args, System.Collections.ObjectModel.ReadOnlyCollection`1[T] parameters, System.Linq.Expressions.LabelTarget returnLabel) [0x000c6] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T] (System.Runtime.CompilerServices.CallSite`1[T] site, System.Object[] args) [0x00019] in <7c7d16af841f44d5a362340966c7fd69>:0
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0) [0x000f1] in <7c7d16af841f44d5a362340966c7fd69>:0
at UnitTest.TestClient+<TestMethodCall>d__2.MoveNext () [0x000f3] in <c0a36338f0ee473a8317e17500d161f9>:0
--- End of stack trace from previous location where exception was thrown ---
at NUnit.Framework.AsyncInvocationRegion+AsyncVoidInvocationRegion.WaitForPendingOperationsToComplete (System.Object invocationResult) [0x0001b] in <746131cbfdc6477ab4c97256f2af20a6>:0
at NUnit.Core.NUnitAsyncTestMethod.RunTestMethod () [0x00016] in <746131cbfdc6477ab4c97256f2af20a6>:0
https://github.com/sendgrid/csharp-http-client/blob/master/CSharpHTTPClient/Client.cs#L311
Here, the client replaces single quotes with double quotes. That is unexpected behavior.
Single quotes are perfectly valid inside JSON string tokens.
For every release, we currently hand craft a CHANGELOG.md update, now we would like to automate this process. Please see the existing CHANGELOG.md for formatting structure.
See this thread: sendgrid/sendgrid-csharp#146
Sometimes when I try to send email i got this error.
I use this code for sending mails
public void SendMail(String[] recipients, String subject, String body)
{
var client = new SendGridAPIClient(Core.Settings.Current.SendGridKey);
var from = new Email(Core.Settings.Current.From);
var content = new Content("text/html", body);
foreach (var email in recipients)
{
var to = new Email(email);
var mail = new Mail(from, subject, to, content);
dynamic response = client.client.mail.send.post(requestBody: mail.Get());
}
}
Access forbidden error with Visual Studio 2013-Full working code from https://github.com/sendgrid/csharp-http-client/blob/master/Example/Example.cs
Console shows an error as attached.
When all tests on the master branch pass in Travis CI, we would like to auto-deploy the release to the package manager.
Before writing any code, we suggest you review our CONTRIBUTING.md
file and propose your solution for discussion here in the comments. Thank you!
CHANGELOG.md
Hacktoberfest 2017 has completely blown us away. We have had over 900 pull requests from over 300 contributors all in the last 30 days. That is more PRs than we normally get in 2 years!
We are actively working to review, comment, and/or merge as many PRs as we possibly can as quickly as we can.
We are currently working on “intaking” all the PRs that have come in, oldest first (we have about 400 remaining to go through). We are making sure that each PR we review is one we have a chance of merging - there have been a couple spammy items that came through. Due to the massive influx of requests so far, @thinkingserious and @mbernier have been working nights and weekends all month just to keep up! We’re not even mad, this is amazing!
If you have signed the CLA before 11/1, but haven’t had a PR merged yet, do not despair! We know we are behind on even just commenting on every PR to show you that we received it (something we typically do). If you submitted a mergeable (non-spam, actually adds value to the project) PR during October 2017, we will grant access to this page to redeem your shirt, sticker, and hacker pin. Next year, we will be sure to communicate this information sooner. We are sorry for any confusion we have caused. We appreciate those of you who have reached out to find out what’s going on!
Have you signed the CLA yet?
We can only merge items from contributors who signed the CLA
Can you help another contributor?
If you can identify potential problems, add suggestions, or even leave a comment with your review of another PR (Looks good to me! Or I approve this change), that would help us review those PRs much faster, making it easier to get to your PR.
Do you even write tests, friend?
If you see a place where we could have a test to validate a piece of functionality, add it in. We know We know! It’s just another PR we have to review and merge. You’re right, it is! However, the more tests we have, the earlier our CI tool can catch issues, saving us a review as well as back and forth time.
Issue Summary
Add this to our travis.ci configuration so that code coverage tests will run!
It is possible to configure how CodeClimate looks at a repository.
These Docs explain how this is done. Please create an appropriate .codeclimate.yml for this repo. It should test the main language of the repo and run tests.
Our open sourced documentation has a great first time contributor page that we wish to duplicate here.
I apologize for the blunt question, but why not just use HttpClient
?
What's the difference between sgClient.your.api.get()
and httpClient.GetAsync("Your/API")
?
The former might be confusing to C# developers, as the API calls are not truly type safe and are pretty much equivalent to the string...
Hi Folks ,
Please share me sample c# code for oauth validation for webhook
Please help me
Send grid , I have map my own client id and secret , please find the sample screen shot.
C#:
HttpResponseMessage response = new HttpResponseMessage();
//var header = Request.Headers.Authorization.ToString();
//string token = header.Replace("Bearer ", "");
//bool IsValid = ValidateToken(token);
//if (IsValid)
TravisCI is reporting the following error:
The command "mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe UnitTest/bin/Release/UnitTest.dll -domain:None" exited with 2.
ASP.net webforms project.
Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?
If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some great information on how to review a Pull Request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.