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,
This is the one you can see on LiveHttpHeaders
Dim postData As String = "author=" & txtUser.Text & "&email=" & txtEmail.Text & "&url=" & txtWebsite.Text & "&comment=" & txtMessage.Text & "&submit=&comment_post_ID=" & stringA
tried to remove the &comment_post_ID , it woudn't give me an error, but it doesnt give me a result also, its like a blank result.
the referURL, is originally a url, i just substitute it temporarily as "url", but its really a url inside
do you have an idea how to tweak this?