1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HttpWebRequest (Wrap / Convert strange characters) E%3C%2Fdiv%

Discussion in 'Visual Basic .NET' started by Free6, Jan 14, 2017.

  1. Free6

    Free6 Newbie

    Joined:
    Nov 21, 2016
    Messages:
    31
    Likes Received:
    0
    Gender:
    Female
    Hi, I'm trying to make a HttpWebRequest and I have to make the Description text dynamic but there are strange characters within that I have to convert / wrap first maybe.

    In brief, I'm gonna put a TextBox to fill the Description but reading that line, it's a mixed of strange characters in "Description" section.

    Please how do i do solve this?

    Code:
    Dim body As String = "locationId=3100529&categoryId=9227&machineId=8082c5b9-fde3-443a-97a8-dd82680fb01c-15992400abb&completenessPercentage=64&munchkinId=038-AZF-323&_mrk_trk=&ForSaleBy=&Title=Addidas+Presto+for+Sale&Description=Addidas+Presto+for+sale.%3Cdiv%3E%3Cbr%3E%3C%2Fdiv%3E%3Cdiv%3EOpen+to+Neg.%3C%2Fdiv%3E%3Cdiv%3E%3Cbr%3E%3C%2Fdiv%3E%3Cdiv%3EContact+me+for+Price%3C%2Fdiv%3E&WebSiteUrl=&u=Penguins.jpg&profilePicture=&picturesThumb=https%253A%252F%252Fi.ebayimg.com%252F00%252Fs%252FNjAwWDgwMA%253D%253D%252Fz%252FduoAAOSw-0xYd1ze%252F%2524_14.JPG&pictures=https%253A%252F%252Fi.ebayimg.com%252F00%252Fs%252FNjAwWDgwMA%253D%253D%252Fz%252FduoAAOSw-0xYd1ze%252F%2524_18.JPG&priceTypes=FIXED&Price=&currencyValues=ZAR&UserName=Orange&Email=myemail145%40gmail.com&Phone=123456789&latitude=&longitude=&adminAreaName=&addressConfidenceLevel=&countryCode=&street=&locality=&Address="
    
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,928
    Likes Received:
    1,944
    Home Page:
    This is simply URL Encoded, see here:
    http://meyerweb.com/eric/tools/dencoder/

    Input:
    "%3Cdiv%3E%3Cbr%3E%3C%2Fdiv%3E%3Cdiv%3EOpen+to+Neg.%3C%2Fdiv%3E"

    Output:
    <div><br></div><div>Open to Neg.</div>
     
  3. Free6

    Free6 Newbie

    Joined:
    Nov 21, 2016
    Messages:
    31
    Likes Received:
    0
    Gender:
    Female
    Thanks, Solved !!!

    But what about how to attach a picture in the Form before to Post.
    There's a variable called "u" in the code below that contains the name of the picture I uploaded called "Penguins.jpg",

    I tried to remove the "Penguins.jpg" and put a static link like "c:\mypictures.jpg" in the body string below, but didn't work.

    Need I upload the picture first to their Server? If so, how do I know the new name of my picture then???

    Please can you help?

    Code:
    Dim body As String = "locationId=3100529&categoryId=9227&machineId=8082c5b9-fde3-443a-97a8-dd82680fb01c-15992400abb&completenessPercentage=64&munchkinId=038-AZF-323&_mrk_trk=&ForSaleBy=&Title=Addidas+Presto+for+Sale&Description=Addidas+Presto+for+sale.%3Cdiv%3E%3Cbr%3E%3C%2Fdiv%3E%3Cdiv%3EOpen+to+Neg.%3C%2Fdiv%3E%3Cdiv%3E%3Cbr%3E%3C%2Fdiv%3E%3Cdiv%3EContact+me+for+Price%3C%2Fdiv%3E&WebSiteUrl=&u=Penguins.jpg&profilePicture=&picturesThumb=https%253A%252F%252Fi.ebayimg.com%252F00%252Fs%252FNjAwWDgwMA%253D%253D%252Fz%252FduoAAOSw-0xYd1ze%252F%2524_14.JPG&pictures=https%253A%252F%252Fi.ebayimg.com%252F00%252Fs%252FNjAwWDgwMA%253D%253D%252Fz%252FduoAAOSw-0xYd1ze%252F%2524_18.JPG&priceTypes=FIXED&Price=&currencyValues=ZAR&UserName=Orange&Email=myemail145%40gmail.com&Phone=123456789&latitude=&longitude=&adminAreaName=&addressConfidenceLevel=&countryCode=&street=&locality=&Address="
     
     
  4. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,928
    Likes Received:
    1,944
    Home Page:
    You must record the data of the image being uploaded with a program such as CharlesProxy / Fiddler & then replicate this. The server will then respond with the location of the uploaded image which you must add to the data you are sending.
     
  5. Free6

    Free6 Newbie

    Joined:
    Nov 21, 2016
    Messages:
    31
    Likes Received:
    0
    Gender:
    Female
    Thanks for your reply,

    I solved everything since December last year.

    Thanks again !!!