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
Diptyajit Dey
NA
98
22.5k
How to Pass special character in Web API Post method?
Jul 17 2017 3:03 AM
How to Pass special character in Web API Post method? I am saving the special character like '&',''' in web api via post method.
Problem is when I am passing the special character via parameter then special character is being removed by the Web API and the value is being saved without special character.
I have first created a Web API. Then this Web API call the your asp.net project. I am calling the Web API via Web client. Please see the exp:
string
URI = ApiBaseURL +
"project/Updateproject"
;
string
myParameters =
"ProjectId="
+ projectid +
"&ProjectStatusId="
+ projectstatusid +
"&ProjectName="
+ projectname +
"&ProjectImage="
+ fileName +
"&Description="
+
description +
"&FloorPlan="
+ floorplan +
"&ProjectAddress="
+ address +
"&ProjectCategoryId="
+ projectcategoryid +
"&CityId="
+ cityid +
"&ProjectBudgetLowPrice="
+ budgetlowprice +
"&ProjectBudgetHighPrice="
+
budgethighprice +
"&ProjectLogo="
+ ProjectLogo +
"&YoutubeLink="
+ youtubelink +
&FeaturePropertyFlag=
" + featuredpropertyflag + "
&Property=
" + property + "
&Video=" +
+
"&Phone="
+ phone +
"&SocialContactNo="
+ socialPh +
"&PpcContactNo="
+ ppcphone +
"&ThreeSixtyDegreeVideo="
+ threesixtyfilelink +
"&LoyaltyPoint="
+ loyaltypoint +
"&ProjectDurationId="
+ ProjectDurationId +
"&latitude="
+ latitude +
"&longitude="
+
longitude +
"&PhotoGallaryShrtDesc="
+ PhotoGallaryShrtDesc +
"&LocationShrtDesc="
+
LocationShrtDesc +
"&LandingViewFlag="
+ LandingViewFlag +
"&ProjectBudgetRange="
+ ProjectBudgetRange +
"&ProjectLinkId="
+ ProjectLinkId +
"&ProjectExternalLink="
+
ProjectExternalLink;
using
(WebClient wc =
new
WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] =
"application/x-www-form-urlencoded"
;
HtmlResult = wc.UploadString(URI, myParameters);
}
Reply
Answers (
1
)
Can we implement Alexa Voice Service in Asp.net?
Fetching data from DB by clicking on TAB in MVC.