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
Bhavesh Ghul
820
1k
54.5k
too many automatic redirections were attempted webclient c#
Oct 9 2019 10:11 AM
Hello anyone can you, please help below error...?
public
void
Index()
{
string
URI =
"www.url.com/addform"
;
try
{
using
(WebClient wc =
new
WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] =
"multipart/form-data"
;
wc.Headers[
"Host"
] =
"www.url.com"
;
wc.Headers[
"X-CSRF-TOKEN"
] =
"df7641fe-1168-4952-a203-fa96909db251"
;
wc.Headers[
"X-Requested-With"
] =
"XMLHttpRequest"
;
wc.Headers.Add(HttpRequestHeader.Cookie,
"JSESSIONID=6CDB5B4F952F0A996E0C035288771CE7; path=/; domain=.
www.url.com
;"
);
GWModel oGWModel =
new
GWModel();
oGWModel.refStateId =
"10"
;
oGWModel.refDistrictId =
"74"
;
oGWModel.refBlockTehsilId =
"4328"
;
oGWModel.refVillageId =
"281394"
;
oGWModel.enumerationDate =
"28/09/2019"
;
var data =
new
JavaScriptSerializer().Serialize(oGWModel);
string
HtmlResult = wc.UploadString(URI,
"POST"
, data);
}
}
catch
(Exception ex)
{
throw
;
}
}
Exception Throw - too many automatic redirections were attempted.
Thanks & Regards
Bhavesh
Reply
Answers (
2
)
Custom pagination asp.net gridview
split datatable and send it to ajax response one by one