post - Using HTTPWebRequest for postdata...what am I missing here? -
i've been designing program helps users navigate , use online dating sites. part of program allows users send message through program, i'm having trouble website pof.com.
i've verified postdata variable turning out string matches browser send. here code assume problem lies:
pofmessage = httputility.urlencode(pofmessage) dim postdata string = sendparameter1 & "=" & sendparameter1_value & "&autologinid=" & autologinid & "&message_id=" & messageid & "&u=" & u & "&p_id=" & p_id & "&receiver=" & receiver & "&profile_idb=" & profile_idb & "&usersendtob=" & usersendtob & "&i=" & & "&v=" & v & "&subject=" & pofsubject & "&message=" & pofmessage & "&sendmessage=send+quick+msg" dim encoding new utf8encoding dim bytedata byte() = encoding.getbytes(postdata) 'postdata = "7512b8a8=b5818092d0d1d696329a2f6a8e9ef5b7&autologinid=vfnbrfzx4cptyhoimlojxs54&message_id=&u=ca_polo&p_id=40749839&reciever=janebrandy2000&profile_idb=40749839&usersendtob=44672906&i=18213689&v=13&subject=hi&message=sorry...i+meant+my+great+grandmother.++she+was+a+very+sweet+person.&sendmessage=send+quick+msg" dim postreq httpwebrequest = directcast(webrequest.create("http://www.pof.com/sendmessage.aspx"), httpwebrequest) postreq.method = "post" postreq.keepalive = true postreq.cookiecontainer = logincookie postreq.contenttype = "application/x-www-form-urlencoded" postreq.referer = "http://www.pof.com/viewprofile.aspx?profile_id=" & profileaddresssend(arrayindex) postreq.useragent = "mozilla/5.0 (windows nt 6.1; wow64; rv:11.0) gecko/20100101 firefox/11.0" postreq.contentlength = bytedata.length messagebox.show(postdata) dim postreqstream stream = postreq.getrequeststream() postreqstream.write(bytedata, 0, bytedata.length)
i don't know if useful, here live http headers gave me:
--------------begin headers--------------------------- http://www.pof.com/sendmessage.aspx post /sendmessage.aspx http/1.1 host: www.pof.com user-agent: mozilla/5.0 (windows nt 6.1; wow64; rv:13.0) gecko/20100101 firefox/13.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate dnt: 1 connection: keep-alive referer: http://www.pof.com/viewprofile.aspx?profile_id=40749839 cookie: ft=friday, may 04, 2012 10:56:08 pm; __utma=181982502.1869691959.1336197311.1339544889.1339562544.21; __utmz=181982502.1338435116.11.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); usernameb=my_username; tmp_track=18213689; __utmv=181982502.|2=intent=want%20to%20date%20but%20nothing%20serious=1^3=age=35=1^4=gender=male%20united%20states=1; __gads=id=b617d731de96c1fd:t=1336199229:s=alni_matmf9mj4cczigfuccbsyfh-o2cda; tbtext002=dating%2ca; t_user_id=18213689; asp.net_sessionid=vfnbrfzx4cptyhoimlojxs54; __utmc=181982502; pofimsession=634751342250621962; __utmb=181982502.4.10.1339562544; alogin=vfnbrfzx4cptyhoimlojxs54; mp_60ea1aa63a18cdb7ab1fb007106b9de3_mixpanel=%7b%22distinct_id%22%3a%20%22137d031c4821a4-050684bdf5e497-43534134-100200-137d031c4837d%22%2c%22%24initial_referrer%22%3a%20%22%24direct%22%2c%22%24initial_referring_domain%22%3a%20%22%24direct%22%7d content-type: application/x-www-form-urlencoded content-length: 308 7512b8a8=b5818092d0d1d696329a2f6a8e9ef5b7&autologinid=vfnbrfzx4cptyhoimlojxs54&message_id=&u=my_username&p_id=40749839&reciever=janebrandy2000&profile_idb=40749839&usersendtob=44672906&i=18213689&v=13&subject=hi&message=this+is+a+sample+message&sendmessage=send+quick+msg http/1.1 302 found cache-control: private content-type: text/html; charset=utf-8 location: /inbox.aspx?messagesent=1&p_id=40749839&guid=18213689&sid=vfnbrfzx4cptyhoimlojxs54#in server: microsoft-iis/7.5 x-aspnet-version: 4.0.30319 x-powered-by: asp.net date: wed, 13 jun 2012 04:44:32 gmt content-length: 214 -----------------------end headers---------------------
this i've verified (i think...unless i'm missing something): postdata accurate. cookie use works navigating through site (ie if wanted view inbox, cookie allow me that. if cookie didn't work, couldn't view inbox).
what missing here?
Comments
Post a Comment