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

Add documentation for using HttpClient to send POST/PUT requests #208

Open
Whipstickgostop opened this issue Aug 19, 2024 · 0 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@Whipstickgostop
Copy link
Member

Either a new examples entry, or a new area in the C# page.
Or event add some way to link examples from pages, in order to link it directly from the Fetch URL sub-action page. 🤔

Will think this over...

Additional context
Rondhi's HttpClient docs

PUT Example:

// Create an object to send as JSON
var data = new
{
   Id = 1,
   Name = "John Doe",
   Email = "[email protected]"
};

// Serialize the object to JSON
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");

// Send PUT request
HttpResponseMessage response = await _httpClient.PutAsync("https://some-url.com", content);
@Whipstickgostop Whipstickgostop added the documentation Improvements or additions to documentation label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant