none
HttpWebRequest PUT with json RRS feed

  • Question

  • 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", "https://www.easports.com")
            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 = "https://www.easports.com/fifa/ultimate-team/web-app/"
            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()

    Sunday, January 5, 2020 8:04 PM

All replies

  • Hi,

    Could you share us a screen shot about your current result or error message?

    It could be better to help us to find the root cause.

    In addition, this is a similar question about how to make a PUT request (web request/httprequest) in vb.net.

    Hope it be helpful.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 6, 2020 7:01 AM
    Moderator