TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arya raj
NA
57
34.7k
how to pass query string and path paramter in httpgetasync
Jul 30 2019 3:39 AM
I need to pass query string and path parameters to HttpClient GetAsync() method in .NET
File/{document_id}?version={version_number}
[Route(
"api/drs/v1/document/getdetails/{Id}"
)]
[HttpGet] public async Task<HttpResponseMessage> DocumentDetails(HttpRequestMessage details)
{ // Debugger.Launch();
try {
using (HttpClient client = new HttpClient()) {
client.DefaultRequestHeaders.Accept.Clear(); //String path=Request.Url.GetLeftPart(UriPartial.Path);
HttpResponseMessage response = await client.GetAsync(
"http://localhost:8089/api/drs/v1/document/Files/"
]);
if (response.IsSuccessStatusCode) {
Console.Write(
"Success"
); }
else { Console.Write(
"Failure"
);
} return response; }
} catch (Exception e)
{ throw e; } }
Reply
Answers (
1
)
Create chart dynamically according to year and month wise
How to set stored procedure value to textbox ASP.NET MVC 5