We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public static class ResponseMessageExtensions { public static void EnsureSuccessStatusCodeEx(this HttpResponseMessage responseMessage) { if (!responseMessage.IsSuccessStatusCode) { var responseText = responseMessage.Content.ReadAsStringAsync().Result; var contentType = responseMessage.Content.Headers.ContentType; throw new WebApiRequestException(responseMessage.ReasonPhrase, responseMessage.StatusCode, responseText, responseMessage.Headers, contentType); } } }
Imports System.Runtime.CompilerServices Public Module ResponseMessageExtensions <Extension()> Public Sub EnsureSuccessStatusCodeEx(Me responseMessage As HttpResponseMessage) If Not responseMessage.IsSuccessStatusCode Then Dim responseText = responseMessage.Content.ReadAsStringAsync().Result Dim contentType = responseMessage.Content.Headers.ContentType Throw New WebApiRequestException(responseMessage.ReasonPhrase, responseMessage.StatusCode, responseText, responseMessage.Headers, contentType) End If End Sub End Module
Module ResponseMessageExtensions <Extension()> Public Sub EnsureSuccessStatusCodeEx(ByVal _responseMessage As HttpResponseMessage) If Not _responseMessage.IsSuccessStatusCode Then Dim responseText = _responseMessage.Content.ReadAsStringAsync().Result Dim contentType = _responseMessage.Content.Headers.ContentType Throw New WebApiRequestException(_responseMessage.ReasonPhrase, _responseMessage.StatusCode, responseText, _responseMessage.Headers, contentType) End If End Sub End Module
According to: https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
I am using https://icsharpcode.github.io/CodeConverter/ as of today.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Input code
Erroneous output
Expected output
According to: https://learn.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/procedures/extension-methods
I am using https://icsharpcode.github.io/CodeConverter/ as of today.
The text was updated successfully, but these errors were encountered: