HttpWebRequest PUT with json

  • Thread starter Thread starter castlehere
  • Start date Start date
C

castlehere

Guest
hello guys

i wanna send put httpwebrequest wit data json

i try do'it but did't work

Dim req2 As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://utas.external.s2.fut.ea.com/ut/game/fifa20/trade/" & iteamid & "/bid"), HttpWebRequest)
req2.Method = "PUT"
req2.Host = "utas.external.s2.fut.ea.com"
req2.Headers.Add("Connection", "keep-alive")
req2.Headers.Add("X-UT-SID", "b27215a9-c3d4-4df5-ae37-3a5f9eb42e98")
req2.Headers.Add("Origin", "EA SPORTS | Sports video games | Football, Soccer, Golf, Basketball, Boxing, Hockey, Fighting")
req2.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
req2.ContentType = "application/json"
req2.Accept = "*/*"
req2.Headers.Add("Sec-Fetch-Site", "cross-site")
req2.Headers.Add("Sec-Fetch-Mode", "cors")
req2.Referer = "FUT Web App - EA SPORTS Official Site"
req2.Headers.Add("Accept-Language", "ar,en-US;q=0.9,en;q=0.8")
req2.Headers.Add("Content-Length", "11")
req2.AddJson("bid", "200")
Dim HttpWebResponse2 As HttpWebResponse
HttpWebResponse2 = DirectCast(req2.GetResponse, HttpWebResponse)
Dim StreamReader2 As New StreamReader(HttpWebResponse2.GetResponseStream())
Dim result2 As String = StreamReader2.ReadToEnd.ToString()

Continue reading...
 
Back
Top