aronquiray
Member
- Joined
- Oct 13, 2011
- Messages
- 8
- Programming Experience
- 1-3
Hello again vbforums,
i got a small piece of problem hope you can help me out.
basically. i know how to do the login in different sites using httpwebrequest..
but now, i was working with something like. i am trying to comment to one of my wordpress website,
but i am stuck with the post respone i'm getting an error of.
The remote server returned an error: (500) Internal Server Error.
but when I will try to login in wordpress, with the format of login post data.. it logs me,
hoping for an answer thanks!
i got a small piece of problem hope you can help me out.
basically. i know how to do the login in different sites using httpwebrequest..
but now, i was working with something like. i am trying to comment to one of my wordpress website,
Dim postData As String = "author=" & txtUser.Text & "&email=" & txtEmail.Text & "&url=" & txtWebsite.Text & "&comment=" & txtMessage.Text & "&submit=&comment_post_ID=" & stringA Dim tempcookies As New CookieContainer Dim encoding As New UTF8Encoding Dim byteData As Byte() = encoding.GetBytes(postData) Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://www.myurl.com/wp-comments-post.php"), HttpWebRequest) postreq.Method = "POST" postreq.KeepAlive = True postreq.CookieContainer = tempcookies postreq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729" postreq.ContentType = "application/x-www-form-urlencoded" postreq.Referer = "url" postreq.ContentLength = byteData.Length Dim postreqstream As Stream = postreq.GetRequestStream() postreqstream.Write(byteData, 0, byteData.Length) postreqstream.Close() Dim postresponse As HttpWebResponse postresponse = DirectCast(postreq.GetResponse, HttpWebResponse) tempcookies.Add(postresponse.Cookies)
but i am stuck with the post respone i'm getting an error of.
The remote server returned an error: (500) Internal Server Error.
but when I will try to login in wordpress, with the format of login post data.. it logs me,
hoping for an answer thanks!