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
Rahul Rai
1.6k
149
11k
transfer mvc controller data Json format in Web Api method
May 11 2019 5:15 AM
public async Task<string> UploadImage(HttpPostedFileBase objFile, string user_id)
{
Session["imgfile"] = objFile;
Session["user_id"] = user_id;
//string anykey = string.Empty;
string responseString = string.Empty;
string name="";
string type = "";
if (objFile != null)
{
JObject payLoad = new JObject(
new JProperty("anykey",
new JObject(
new JProperty("KidYhE", 3288),
new JProperty("type", "QUERY")
),
new JProperty(objFile.FileName)
//new JProperty("password", "User Password"),
//new JProperty("token", "xxxxxx")
)
);
using (HttpClient client = new HttpClient())
{
var httpContent = new StringContent(payLoad.ToString(), Encoding.UTF8, "multipart/form-type");
using (HttpResponseMessage response = await client.PostAsync("http://192.168.0.187:8081/ImageUpload/Upload", httpContent))
{
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
//return JObject.Parse(responseBody);
}
}
}
Reply
Answers (
1
)
Add new row to gridview not working inside repeater control
play some tune when on new message display