Page 2 of 3 FirstFirst 123 LastLast
Results 41 to 80 of 87

Thread: Winsock: Making HTTP POST/GET Requests

  1. #41
    Lively Member
    Join Date
    Aug 2008
    Posts
    75

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by batori
    Great post ... i already learned some stuff with your app...

    But i was wondering...
    Once that i got all the cookie data and stuff with logging in...

    How do i manage to send that cookie data with another post request?
    I tried with inet1.execute.... but wont work


    Thanks again for this tutorial
    store it in a global var...
    How To Make A Youtube Downloader
    I use Visual Studio 2008 Pro...

  2. #42
    New Member
    Join Date
    Jul 2009
    Posts
    1

    Exclamation Re: Winsock: Making HTTP POST/GET Requests

    Hi.
    Help!!! Some symbols like + and = don't send using WinHTTPRequest.Send
    And how to send multiple variables?

  3. #43
    New Member
    Join Date
    Jul 2009
    Posts
    4

    Re: Winsock: Making HTTP POST/GET Requests

    Thank you very much for the tutorial. This is the only place I could find that had a tut about the winsock and http.

    I have made a new thread about this problem here if you would be so kind as to read it

    I can log into phpbb forums but when I try to post I get

    Invalid Session. Please resubmit the form.

    I'm sending the following to the server:

    POST /community/posting.php?mode=post&f=26&sid=e5ab54e065e67b736f0e04e30287e880 HTTP/1.0
    Host: www.phpbb.com
    Accept: "/"
    Content-Type: application/x-www-form-urlencoded
    Referer: http://www.phpbb.com/community/ucp.php
    Content-Length: 54
    Connection: Keep-Alive
    Cache-Control: No-Cache
    Cookie: phpbb3mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3 A5%3A%2286360%22%3B%7D; phpbb3mysql_sid=e5ab54e065e67b736f0e04e30287e880

    subject=Thanks&description=&message=Thanks&post=submit

  4. #44
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by Under_Developed View Post
    Thank you very much for the tutorial. This is the only place I could find that had a tut about the winsock and http.

    I have made a new thread about this problem here if you would be so kind as to read it

    I can log into phpbb forums but when I try to post I get

    Invalid Session. Please resubmit the form.

    I'm sending the following to the server:
    Probably sending a bad/expired session id.

    Cookie: phpbb3mysql_data=a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3 A5%3A%2286360%22%3B%7D; phpbb3mysql_sid=e5ab54e065e67b736f0e04e30287e880
    You'll need to parse out the cookie and session id that the server sends back to you, put it in a variable, and send it with future GET/POST requests.

  5. #45
    New Member
    Join Date
    Jul 2009
    Posts
    4

    Re: Winsock: Making HTTP POST/GET Requests

    Thank you for the reply will try that.

  6. #46
    New Member
    Join Date
    Dec 2009
    Posts
    1

    Re: Winsock: Making HTTP POST/GET Requests

    Hi,
    how attach jpg image in your code
    please help

  7. #47
    New Member
    Join Date
    Jan 2010
    Posts
    3

    Re: Winsock: Making HTTP POST/GET Requests

    Great program, I'm using winsock and I'm running into a problem and I noticed your program does the same thing

    In your program, use the GET method and go to

    news.yahoo.com

    when the data comes in, scroll all the way to the bottom of the data,
    you'll notice that it is truncated. This is just an example, there are tons of other web sites that this happens to too.

    I've been getting headaches on how to fix this problem, I need to be able to retrieve web page data with winsock. Got any ideas?
    Last edited by HookahSchwa; Jan 6th, 2010 at 12:57 AM.

  8. #48

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Winsock: Making HTTP POST/GET Requests

    There is a limit of 64k to the length of strings in Visual Basic 6 and a 32k limit on the text box. If you want to display everything then consider the rich text control and retrieve the response from the server in 1000 byte chunks and append to the control.

    This program is only a demonstration of how to format the requests so you will need to make modifications to the code to make it do what you require.
    Last edited by visualAd; Jan 6th, 2010 at 04:28 PM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #49
    New Member
    Join Date
    Jan 2010
    Posts
    3

    Re: Winsock: Making HTTP POST/GET Requests

    Do you have an example of how do set the winsock control to receive data in chunks?

  10. #50
    New Member
    Join Date
    Jan 2010
    Posts
    3

    Re: Winsock: Making HTTP POST/GET Requests

    Nevermind I found the maxlen argument thank you for explaining what that problem was!

  11. #51
    Hyperactive Member
    Join Date
    Jul 2009
    Posts
    489

    Re: Winsock: Making HTTP POST/GET Requests

    with this program
    is it possible to login to hotmail account.
    i mean as i use the explorer to login through the login page.
    i want to do that with a vb app, not with the explorer.
    is it possible with this program ?
    if yes, an example code would be much appreciated.

  12. #52
    New Member
    Join Date
    Jan 2010
    Posts
    1

    Re: Winsock: Making HTTP POST/GET Requests

    The URL Encode function is wrong.
    If the character code is less than 16 the hex code is only one symbol. It must be with a leading zero. Might be fixed this way:

    Code:
    If curChar < 16 Then
        newStr = newStr & "%0" & Hex(curChar)
    Else
        newStr = newStr & "%" & Hex(curChar)
    End If
    Or this way:

    Code:
    newStr = newStr & "%" & Right("0" & Hex(curChar), 2)

  13. #53
    Hyperactive Member
    Join Date
    Jul 2009
    Posts
    489

    Re: Winsock: Making HTTP POST/GET Requests

    hay,
    i attached a zip, which contain a text file i got from:
    live server on "login.live.com"
    this is a html file of the login page, that i managed retrieve via winsock,
    but i don't know how to continue,
    what the exact text i need to send back, with my username and password,

    can someone please post the exact string i need to send back to the server
    with my username and password.

    you can write in the username: whatsup
    in the password: 00000000
    so i can find exactly what you did.

    thanks in advance.
    Attached Files Attached Files

  14. #54
    New Member
    Join Date
    Mar 2010
    Posts
    2

    Re: Winsock: Making HTTP POST/GET Requests

    Hello All,

    I am new to this forum, this is my first post and I need help

    I just downloaded the zip package from first post. Attempted to run the project on MS Visual Studio 2005, which attempted to convert the project from VB6 to VB2005 . Now, when I run the application and do exactly what I am supposed to do, the request and output boxes confirm that, it communicates to the server as http://hostname/myfile.php?var1=xx&var2=yy&var3=zz but, no data passes through.

    Though I made some modifications , I now have no manual modifications (except from automatic upgrade). Would anyone please help me by telling what could possibly be wrong?

    In case needed, my post_dump.php is as follows:
    Code:
    <?php 
    
    include_once("dbconnect.php");
    date_default_timezone_set('Europe/London');
    $Day=date("d-m-y H:i");
    if ($_GET): 
    	foreach($_GET as $name => $var) :  
    		$store_array[]=$var;
    	endforeach; 
    endif;
    $var1=$store_array[0];
    $var2=$store_array[1];
    $var3=$store_array[2];
    mysql_query("INSERT INTO `table` (var1,var2,var3,Day)VALUES ('$var1','$var2','$var3','$Day')");
    ?>

  15. #55
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Winsock: Making HTTP POST/GET Requests

    Welcome to VBForums

    Attempting to use VB6 code in VB.Net (VB 2002 and later) is a bad idea, as not only does it take extra effort to get it working, but it is also likely to be much less efficient than the VB.Net methods of achieving the same tasks.

    I recommend you find the equivalent in our VB.Net CodeBank forum instead.

  16. #56
    New Member
    Join Date
    Aug 2010
    Posts
    3

    Re: Winsock: Making HTTP POST/GET Requests

    i hve 1 doubt

    like i log in in some site using post/get Now i done successfully Now my problem is i want to visit user profile page after login my id

    how can i do tht ?
    thnx

  17. #57
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by vvarun View Post
    i hve 1 doubt

    like i log in in some site using post/get Now i done successfully Now my problem is i want to visit user profile page after login my id

    how can i do tht ?
    thnx
    Hi Varun... Welcome to the forums...

    I think you need to store the cookies inorder to continue viewing the user profile. But I'm not sure about that

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  18. #58
    Addicted Member
    Join Date
    Nov 2010
    Posts
    159

    Re: Winsock: Making HTTP POST/GET Requests

    Thankx for demo and code
    sorry I`m not so good in English
    how can make accept sll
    I want try to login to myspace
    I don't know if I need cookies store too!?

    Thankx for help

  19. #59
    New Member
    Join Date
    Apr 2011
    Posts
    1

    Re: Winsock: Making HTTP POST/GET Requests

    hi sir,
    i understand vb code. thanks for ur code. i need one help in this section.
    how to get this variable in php page?
    pls give me sample?

  20. #60
    New Member
    Join Date
    Nov 2010
    Posts
    6

    Re: Winsock: Making HTTP POST/GET Requests

    I will post 2 request to same remotehost without winsock.close or winsock.state 8.

    First post working, but in second post VB said to me Runtime error 400006, wrong connection state. I was removed "winsock.Close" command in "Private Sub winsock_Close()" and removed/modifyed blnConnected checking.

    How to stay connection for using PHP Session id with cookie?

    EDIT: RESOLVED, I dont need stay connection. I can use same Session ID with next cookie.

    @sallong.27
    You must look webpages source code in/near <form> tag. If u want write a tool for using some get/post webpage action, u must learn some basic HTML codes.
    Last edited by Ufkabakan; Jun 18th, 2011 at 02:15 AM.
    Sorry for my bad english... I hope you can understand me.

  21. #61
    New Member
    Join Date
    Nov 2010
    Posts
    6

    Re: Winsock: Making HTTP POST/GET Requests

    URL Encode function is inadequate for UTF8 sybols/chars like Turkish and Chines and Arabic words. I have a resolution
    Example:
    Code:
    Print "ABcdığü !+"
    Print URLEncode("ABcdığü !+")
    Print URLEncode2("ABcdığü !+")
    Result
    Code:
    ABcdığü !+
    ABcd%FD%F0%FC%20%21%2B
    ABcd%C4%B1%C4%9F%C3%BC%20%21%2B
    General Declaratetions
    Code:
    Private Declare Function WideCharToMultiByte Lib "kernel32" ( _
    ByVal CodePage As Long, ByVal dwFlags As Long, _
    lpWideCharStr As Any, ByVal cchWideChar As Long, _
    lpMultiByteStr As Any, ByVal cchMultiByte As Long, _
    ByVal lpDefaultChar As Long, lpUsedDefaultChar As Long) As Long
    Modul
    Code:
    Public Function URLEncode2(ByRef Text As String) As String
    Dim UTF8Bytes() As Byte
    
        Dim lngA As Long, strChar As String
        For lngA = 1 To Len(Text)
            strChar = Mid$(Text, lngA, 1)
            If strChar Like "[A-Za-z0-9]" Then
            Else
               If strChar = "=" Then
               Else
                W2UTF8 strChar, UTF8Bytes
                strChar = HexEncode(UTF8Bytes)
               End If
            End If
            URLEncode2 = URLEncode2 & strChar
        Next lngA
    End Function
    
    
    Function W2UTF8(W As String, UTF8() As Byte) As Long
    Dim Bytes&
    If LenB(W) = 0 Then Exit Function
    ReDim UTF8(LenB(W) + 16)
    Bytes = WideCharToMultiByte(65001, 0, ByVal StrPtr(W), Len(W), _
    UTF8(0), UBound(UTF8), 0, ByVal 0&)
    
    ReDim Preserve UTF8(Bytes - 1)
    W2UTF8 = Bytes
    End Function
    
    Function HexEncode(B() As Byte)
    Dim i&, HexArr() As String
    ReDim HexArr(UBound(B))
    For i = 0 To UBound(B)
    HexArr(i) = Right$("0" & Hex$(B(i)), 2)
    Next i
    HexEncode = "%" & Join(HexArr, "%")
    End Function
    And i thing we dont need "blnConnected" for checking connection/closed etc. Winsock.state have a state parameter for it:

    WinSock.State = sckClosed = 0
    WinSock.State = sckOpen = 1
    WinSock.State = sckListening = 2
    WinSock.State = sckConnectionPending = 3
    WinSock.State = sckResolvingHost = 4
    WinSock.State = sckHostResolved = 5
    WinSock.State = sckConnecting = 6
    WinSock.State = sckConnected = 7
    WinSock.State = sckClosing = 8
    WinSock.State = sckError = 9

    Example:
    Waiting Close connection before new connection:
    Code:
            Do Until winsock.State = 0
            DoEvents
            Loop
    Sorry for my bad english... I hope you can understand me.

  22. #62
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423

    Re: Winsock: Making HTTP POST/GET Requests

    How can I use to send utf-8 value request to http ?
    The php page give me the result of variable I sent as ???
    The only easy day was yesterday

  23. #63
    New Member
    Join Date
    Nov 2010
    Posts
    6

    Re: Winsock: Making HTTP POST/GET Requests

    @naruponk
    Im sory i cant understand, what do u want clearly. This UTF-8 function can URL encoding for unicode strings like UTF-8 Russian or Greak or Turkish words.
    Sorry for my bad english... I hope you can understand me.

  24. #64
    New Member
    Join Date
    Aug 2011
    Posts
    2

    Re: Winsock: Making HTTP POST/GET Requests

    Can someone please help me do this exact thing but with multiple urls?? My vb is poor.

  25. #65
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    294

    Talking Re: Winsock: Making HTTP POST/GET Requests

    Some one can upgrade this code to vb 2010? If yes it will be very helpfull!

  26. #66
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by romanos8 View Post
    Some one can upgrade this code to vb 2010? If yes it will be very helpfull!
    It would probably be better if you rewrite it for use with Visual Basic .NET.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  27. #67
    New Member
    Join Date
    Nov 2011
    Posts
    1

    Re: Winsock: Making HTTP POST/GET Requests

    hello!

    how to post a username and password via vb then open the url on firefox?

    for example

    on my vb program

    there are username and password textbox

    then i enter

    when i click the command button ,

    it go to the website with my username and password and the url

  28. #68
    New Member
    Join Date
    Jul 2012
    Posts
    2

    Re: Winsock: Making HTTP POST/GET Requests

    Hello.
    Are you still out there to maybe possibly help me with this? Thanks!

  29. #69
    New Member
    Join Date
    Jul 2012
    Posts
    2

    Re: Winsock: Making HTTP POST/GET Requests

    I modified this app a bit to simplify it but I'm getting some errors. When I try the "Send" command button a second time, "Invalid Operation at Current State" error occurs.
    I am also having timeout problems sending multiple requests. The service is not recording data sent continuosly, hitting the "send" button. I think it has something to do with Winsock and not the service.
    Would someone mind helping me? Thanks!


    Option Explicit

    ' we set this to true whil a connection is established
    Private blnConnected As Boolean

    Dim Transaction_Num As String
    Dim customer As String
    Dim Location As String
    Dim Weight As String
    Dim Sort_Class As String
    Dim ppp As Variant


    Private Sub cmdSend_Click()
    Dim strMethod As String
    Dim strData As String
    Dim strPostData As String
    Dim strHeaders As String

    Dim strHTTP As String
    Dim X As Integer
    Dim tmp As Integer
    Dim Transaction_NumInt As Integer
    Dim thestring As String

    blnConnected = False

    strPostData = ""
    strHeaders = ""

    If blnConnected Then Exit Sub

    '"GET
    'For all loads: http://ics.etechsystems.com:3000/col..._loads_on_belt (test) or http://192.168.0.21:3000/colmac/current_loads_on_belt (on site)
    'To query a single load: http:// ics.etechsystems.com:3000/colmac/get_load/x (test) or http:// 192.168.0.21:3000/colmac/get_load/x (on site)
    'For this service the x should be replaced with the tranaction_number you would like to find.
    ' txtUrl.Text = "http://ics.etechsystems.com:3000/colmac/current_loads_on_belt"
    ' txtUrl.Text = "http://ics.etechsystems.com:3000/colmac/get_load/1"

    'POST
    'For posting a load during a Colmac dump on belt: http://ics.etechsystems.com:3000/colmac/new_load on site: http://192.168.0.21:3000/colmac/new_load

    ' configure winsock
    winsock.Protocol = sckTCPProtocol
    winsock.RemoteHost = "ics.etechsystems.com"
    winsock.RemotePort = 3000

    strMethod = "POST"

    ' build encoded data the data is url encoded in the form
    strData = ""
    strHTTP = strMethod & " " & "/colmac/new_load" & " HTTP/1.1" & vbCrLf
    strHTTP = strHTTP & "Host: " & "ics.etechsystems.com" & vbCrLf

    Transaction_Num = 304

    Transaction_NumInt = Val(Transaction_Num)
    Transaction_Num = str(Transaction_NumInt)
    customer = "5"
    Location = "2"
    Weight = "3"
    Sort_Class = "4"


    '- See above: Entered the URL http://ics.etechsystems.com:3000/colmac/new_load
    strPostData = strPostData & "<new_load>" & vbCrLf
    strPostData = strPostData & "<transaction_number>" & Transaction_Num & "</transaction_number>" & vbCrLf
    strPostData = strPostData & "<customer>" & customer & "</customer>" & vbCrLf
    strPostData = strPostData & "<location>" & Location & "</location>" & vbCrLf
    strPostData = strPostData & "<weight>" & Weight & "</weight>" & vbCrLf
    strPostData = strPostData & "<sort_class>" & Sort_Class & "</sort_class>" & vbCrLf

    strPostData = strPostData & "</new_load>" & vbCrLf

    strHeaders = "Content-Type:text/xml" & vbCrLf & _
    "Content-Length:" & Len(strPostData) & vbCrLf

    strHTTP = strHTTP & strHeaders
    strHTTP = strHTTP & vbCrLf
    strHTTP = strHTTP & strPostData

    txtRequest.Text = strHTTP

    winsock.Connect

    ' wait for a connection
    While Not blnConnected
    DoEvents
    Wend

    ' send the HTTP request
    winsock.SendData strHTTP

    thestring = "C:\Program Files\Internet Explorer\IEXPLORE.EXE http://ics.etechsystems.com:3000/colmac/get_load/" + Transaction_Num
    Shell thestring

    txtResponse = "Transaction Number: " + Transaction_Num

    Transaction_Num = str(Transaction_NumInt + 1)

    End Sub

    Sub winsock_Connect()
    blnConnected = True
    End Sub

  30. #70
    New Member
    Join Date
    Nov 2012
    Posts
    2

    Red face Re: Winsock: Making HTTP POST/GET Requests

    help me

    i wont to mack my forum poster in vb6 with winsock tool.

    i login the vb forum with this code
    Code:
    Private Sub CommandLogin_Click()
    Dim Packet As String
    Dim Post As String
    Post = "vb_login_username=" & Txtuser & "&vb_login_password=" & Txtpass & "&s=&securitytoken=guest&do=login"
    Packet = "POST /login.php?do=login HTTP/1.1" & vbNewLine
    Packet = Packet & "Host: www.absba.org" & vbNewLine
    Packet = Packet & "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0" & vbNewLine
    Packet = Packet & "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & vbNewLine
    Packet = Packet & "Accept-Language: ar,en-us;q=0.7,en;q=0.3" & vbNewLine
    Packet = Packet & "Connection: keep -alive" & vbNewLine
    Packet = Packet & "Content-Type: application/x-www-form-urlencoded" & vbNewLine
    Packet = Packet & "Content-Length: " & Len(Post) & vbNewLine & vbNewLine & Post
     
     If Winsock.State = 7 Then Winsock.SendData (Packet)
        
    End Sub

    but i cant post my Thread by this code

    Code:
    Private Sub CommandNewThread_Click()
    Dim Packet As String
    Dim Post As String
    Post = "subject=" & Text1 & "&message=" & Text2 & "&wysiwyg=1&iconid=0&f=29&do=postthread&posthash=&poststarttime=&loggedinuser=1026648&sbutton=&parseurl=1&emailupdate=1"
    Packet = "POST /newthread.php?do=postthread&f=2 HTTP/1.1" & vbNewLine
    Packet = Packet & "Host: www.absba.org" & vbNewLine
    Packet = Packet & "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0" & vbNewLine
    Packet = Packet & "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" & vbNewLine
    Packet = Packet & "Accept-Language: ar,en-us;q=0.7,en;q=0.3" & vbNewLine
    Packet = Packet & "Connection: keep -alive" & vbNewLine
    Packet = Packet & "Content-Type: application/x-www-form-urlencoded" & vbNewLine
    Packet = Packet & "Content-Length: " & Len(Post) & vbNewLine & vbNewLine & Post
     
     If Winsock.State = 7 Then Winsock.SendData (Packet)
    thes is the code of http headerrs..

    Code:
    http://www.absba.org/newthread.php?do=postthread&f=29
    POST /newthread.php?do=postthread&f=29 HTTP/1.1
    Host: www.absba.org
    User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: ar,en-us;q=0.7,en;q=0.3
    Accept-Encoding: gzip, deflate
    Connection: keep-alive
    Referer: http://www.absba.org/newthread.php?do=newthread&f=29
    Cookie: bbsessionhash=U-MUbRgiFfdH8CrOlwP67lq8GJKqM3Igc3oDs41kOa8aj4L2gWVKP6yX55dmVNYC; bblastvisit=8dzKEZexLzFgjulJQXO19QSy8xlkBYQ1bsbsuTIiuL0.; bblastactivity=74eMV7PnXeHIAPCBvldA_77lSqVIMSJZ18_d8uexO6M.; __utma=208997954.766644000.1327287630.1327287630.1327287630.1; __utmb=208997954.38.9.1327289126285; __utmc=208997954; __utmz=208997954.1327287630.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); bbforum_view=31_pQ9K5OkHVqpcq_zo8DPYvSjON3yJtS4cq7vlvPh9a-EH1BAmRpPglx5HoPV4KvZo1jbIs0k8L17X2oTEYV4HVb46vM4t2eg-SaFPoEQQ.; bbthread_lastview=tXnsL_aOuY40KNzY0xiOHDG35S0hJQuFQv-XiI1XgBVW0h3NcbP2FwFUDSfvqXtbBIsnOrJpwh7_sRJpF_wHuUWfHDA02Hi0olO9oFk_YPQGzQTtXo_LJRGQtBzCclD2
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 278
    subject=test1&message=test2%3Cbr%3E&wysiwyg=1&iconid=0&s=&securitytoken=1351778534-c987b6ae1f3b93bd32c000d06b175a34ce3972e6&f=29&do=postthread&posthash=&poststarttime=&loggedinuser=1026648&sbutton=%C7%DA%CA%E3%CF+%C7%E1%E3%E6%D6%E6%DA+%C7%E1%CC%CF%ED%CF&parseurl=1&emailupdate=1
    this is the url
    http://www.absba.org/newthread.php?do=postthread&f=29

    Please help me with a simple code...
    Please help me with a simple code...
    Please help me with a simple code...

  31. #71
    New Member
    Join Date
    Oct 2012
    Posts
    7

    Re: Winsock: Making HTTP POST/GET Requests

    thanks U sir,

  32. #72
    New Member
    Join Date
    Aug 2013
    Posts
    12

    Re: Winsock: Making HTTP POST/GET Requests

    in terms of connection, which is faster? winsock or the ms winhttp 5.1?

  33. #73
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by jhai_salvador View Post
    in terms of connection, which is faster? winsock or the ms winhttp 5.1?
    Both would ultimately be doing the same thing so none would be faster.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  34. #74
    New Member
    Join Date
    Aug 2013
    Posts
    12

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by Niya View Post
    Both would ultimately be doing the same thing so none would be faster.
    ohh okay, thanks

  35. #75
    New Member
    Join Date
    Jan 2016
    Posts
    7

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by tony007 View Post
    Many thanks for sharing this cool program with us. I tried to use your code with one of my project with involves loading url from listbox in submission variables value textbox. So i added a listbox that get populated from mysql db. I added a button so that on click it starts looping through listbox item and take each item and put it in submission variables value textbox and click send. What ever i do i can make this working with loop . I encluded the code for my click button but it never works. Could u help me fix this problem.thanks


    VB Code:
    1. ' transfer all urls i loop
    2. Private Sub Command1_Click()
    3.  
    4. Dim i As Long
    5. For i = 0 To List2.ListCount - 1
    6.  
    7. List2.Selected(i) = True
    8. txtVariableValue(0) = List2.List(i)
    9. 'MsgBox List2.List(i)
    10. cmdSend_Click
    11. Next
    12.  
    13. End Sub
    just add : winsock_Close before cmdSend_Click. Let me know if it work

  36. #76
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Re: Winsock: Making HTTP POST/GET Requests

    alva0708, you've just replied to the post which is 10 years old... let me say it again: T-E-N years
    I'm amazed by your grave-digging skills, as I haven't seen such in a while.

  37. #77
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Winsock: Making HTTP POST/GET Requests

    Even better: consider how obsolete all of this is.

    We now have quite a few helper objects in Windows we can use for making HTTP and HTTPS requests, and HTTP may be on the verge of extinction now in favor of HTTPS which this technique is useless for:

    Google Chrome gets ready to mark all HTTP sites as 'bad'

  38. #78
    New Member
    Join Date
    Jan 2016
    Posts
    7

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by MikiSoft View Post
    alva0708, you've just replied to the post which is 10 years old... let me say it again: T-E-N years
    I'm amazed by your grave-digging skills, as I haven't seen such in a while.
    i'm a new member of this forum

  39. #79
    New Member
    Join Date
    Jan 2016
    Posts
    7

    Re: Winsock: Making HTTP POST/GET Requests

    it work for http and https. just remove http or https when you write url on the textbox. ex. https://www.google.com. you should write google.com

  40. #80
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Re: Winsock: Making HTTP POST/GET Requests

    Quote Originally Posted by alva0708 View Post
    i'm a new member of this forum
    So what?

    Quote Originally Posted by alva0708 View Post
    it work for http and https. just remove http or https when you write url on the textbox. ex. https://www.google.com. you should write google.com
    No, it doesn't. That works because Google still supports HTTP connection, but soon it won't anymore.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width