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
Faseeh Haris
NA
150
3.5k
RestSharp Querystring URL issue slash appended automatically
Nov 7 2019 1:19 PM
I am trying to hit smartfile api, this api is working fine using postman, but when i add query string parameter to url it gives me error.
I need below url to be created when request send to smartfile
<a href="https://app.smartfile.com/api/2/path/info/?children=true">https://app.smartfile.com/api/2/path/info?children=true</a>[<a href="https://app.smartfile.com/api/2/path/info/?children=true" target="_blank" title="New Window">^</a>]
but when my code executes It appends slash at the end of info and give me error of forbidden link. this error is only coming due to url. below url is generating from code
<a href="https://app.smartfile.com/api/2/path/info/?children=true">https://app.smartfile.com/api/2/path/info/?children=true</a>[<a href="https://app.smartfile.com/api/2/path/info/?children=true" target="_blank" title="New Window">^</a>]
<pre> string urlParameters = "?children=true";
HttpClient client = new HttpClient();
client.BaseAddress = new Uri("https://app.smartfile.com/api/2/path/info");
//Authorization added somewhere in the code,
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
// List data response.
HttpResponseMessage response = client.GetAsync(urlParameters).Result;</pre>
Reply
Answers (
1
)
Can an abstract class have static methods?
Iterate through input form