Skip to content
New issue

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

Allow to modify the JsonSerializerOptions #41

Open
ydang204 opened this issue Dec 3, 2023 · 0 comments
Open

Allow to modify the JsonSerializerOptions #41

ydang204 opened this issue Dec 3, 2023 · 0 comments

Comments

@ydang204
Copy link

ydang204 commented Dec 3, 2023

Could we provide a way to change the default json options of JsonSerializer?

public static async Task<T> GetAndDeserializeAsync<T>(this HttpClient client, string requestUri, ITestOutputHelper output = null)
{
    HttpResponseMessage obj = await client.GetAsync(requestUri, output);
    obj.EnsureSuccessStatusCode();
    string text = await obj.Content.ReadAsStringAsync();
    output?.WriteLine("Response: " + text);
    return JsonSerializer.Deserialize<T>(text, Constants.DefaultJsonOptions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant