Составление POST запроса - C#
Формулировка задачи:
Есть такая структура запроса:
Host: 173.45.117.66
Connection: keep-alive
sign-code: e826dab7cbc0bd73dd402b8fcbca544e
Origin: http://plarium.hs.llnwd.net
signin-userId: vk**********
server-method: SignIn
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
client-ver: 539
signin-authSeed: ecd395fc913d1985cf487faff75654f9e3d9b77386e9817f4534381e091b6045568e7a6a401ae1b29153f
X-Requested-With: ShockwaveFlash/18.0.0.160
signin-authKey: ***********************
locale-name: ru-RU
Content-Type: text/html
Accept: */*
Referer: http://plarium.hs.llnwd.net/v1/pirat...8646986107.swf
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,uk;q=0.6
Content-Length: 973
И сам запрос:
{"s":{"x":"NaN","d":"Святослав;Холонюк;NaN;ru_RU;0;;","vk":{"b":false},"gr":null,"fl":false,"p":null,"n":"Святослав Холонюк","s":null,"a":true,"t":0,"np":false,"u":"http://cs624831.vk.me/v624831175/3ac9c/NJEHoZCQH7I.jpg","tg":0,"i":"vk78057175","l":"ru-RU"},"i":"vk78057175","t":-180,"rr":null,"mr":"","f":["vk3693104","vk5068999","vk8891347","vk10888905","vk19057602","vk36255084","vk39794254","vk42431998","vk45318804","vk49461347","vk50410656","vk51422118","vk71464015","vk75331274","vk80556238","vk95738091","vk95950509","vk96303868","vk100193739","vk104347275","vk132711738","vk134512516","vk135479249","vk137166289","vk138806727","vk141112791","vk145415111","vk146313498","vk150923861","vk154705302","vk161257799","vk161843483","vk163224386","vk170150799","vk174423707","vk177672251","vk177901689","vk190943744","vk217779229","vk224842461","vk238403408","vk243374315","vk272987811","vk302056268"],"l":"user_apps","c":{"i":1,"v":"1.0"}}
Ссилка куда отправлять:
http://173.45.117.66/PiratesVk/Segment00/segment.ashx
Как правильно отправить все данные? Так как отправляя получаю ответ что запрос неправильный.
Кто то поможет?)
Решение задачи: «Составление POST запроса»
textual
Листинг программы
var postData2 = "[\"vk78057175\"]"; var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://173.45.117.66/PiratesVk/Segment00/segment.ashx"); httpWebRequest.ContentType = "text/html"; httpWebRequest.Method = "POST"; httpWebRequest.Host = "173.45.117.66"; httpWebRequest.KeepAlive = true; httpWebRequest.ContentLength = postData2.Length; httpWebRequest.Headers.Add("sing-code", "1c393967f74f4678b3f474a0ce175e00"); httpWebRequest.Headers.Add("Origin","http://plarium.hs.llnwd.net"); httpWebRequest.Headers.Add("server-method", "GetTouch"); httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36"; httpWebRequest.Headers.Add("client-ver", "539"); httpWebRequest.Headers.Add("locale-name", "ru-Ru"); httpWebRequest.Headers.Add("X-Requested-With", "ShockwaveFlash/18.0.0.194"); httpWebRequest.Accept = "*/*"; httpWebRequest.Referer = "https://plarium.hs.llnwd.net/v1/pirates/client/vk/uc_06_17_1211_635701398646986107.swf"; httpWebRequest.Headers.Add("Accept-Encoding", "gzip, deflate"); httpWebRequest.Headers.Add("Accept-Language", "en-US,en;q=0.8,uk;q=0.6");
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д