Multipart POST Requests HELP Please

Discussion in 'Visual Basic .NET' started by voi_tech, Jul 6, 2013.

  1. voi_tech

    voi_tech Newbie

    Joined:
    Oct 13, 2012
    Messages:
    33
    Likes Received:
    12
    I am very new to VB . NET but have still managed to code small projects with regular POST and GET webrequests. I know a decent amount already.

    I am trying to make a tool for a site that uses the multipart POST request and am failing to figure it out.

    Here is some of the data extracted from the headers of the requests...

    Code:
    Content-Type: multipart/form-data; boundary=---------------------------134911937220404Content-Length: 817
    -----------------------------134911937220404
    Content-Disposition: form-data; name="site_key"
    
    
    kNtXqixV
    -----------------------------134911937220404
    Content-Disposition: form-data; name="submit_hidden"
    
    
    submit_hidden
    -----------------------------134911937220404
    Content-Disposition: form-data; name="site_code"
    
    
    this is the paster
    -----------------------------134911937220404
    Content-Disposition: form-data; name="site_format"
    
    
    1
    
    
    
    I can get the "site_key" value using GET and regex but dont know how to compile a multipart POST request.

    I am sure a lot of you guys know how to do this so a little explanation and sample code would be very helpful for me.

    Thanks in advanced.
     
  2. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,891
    Likes Received:
    12,793
    Occupation:
    Potentate
    Location:
    Asuncion
    multipart is necessary only for transporting binary data (i.e. uploading files). When you aren't doing that, you don't have to use it.
     
  3. voi_tech

    voi_tech Newbie

    Joined:
    Oct 13, 2012
    Messages:
    33
    Likes Received:
    12
    Yes that's true.

    I am working on coding a program for two sites right now.

    1 is a site that has your average picture file that uses miltipart
    2 is pastebin.com (i am trying make a pastebin poster as a learning exercise i guess) but yeah that is multipart POST from the example i posted above.

    Do you have some example code or a really good tut online?

    I have spent the last two days trying to follow various guides online but i am not having much luck following/understanding
     
  4. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,891
    Likes Received:
    12,793
    Occupation:
    Potentate
    Location:
    Asuncion
  5. voi_tech

    voi_tech Newbie

    Joined:
    Oct 13, 2012
    Messages:
    33
    Likes Received:
    12
    Yeah I have read over that earlier but can't seem to wrap my head around everything.

    I will keep reading and trying, im sure I will get it eventually.