CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: wininet

  1. #1
    Join Date
    Aug 1999
    Posts
    3

    wininet

    I'm using the wininet api. I open a request and it works but when I try to
    add request header it returns 0. Here's the code. Any Ideas, why
    OpenRequest works, but AddRequestheaders doesn't. header is the string with
    all the headers I need to add.


    hRequest = HttpOpenRequest(hInternetConnect, "POST", "", _
    "HTTP/1.1", vbNullString, 0, _
    INTERNET_FLAG_NO_CACHE_WRITE, 0)
    ret = HttpAddRequestHeaders(hRequest, header, Len(header), _
    HTTP_ADDREQ_FLAG_ADD)


    Any help would be greatly appreciated.



  2. #2
    Guest

    Re: wininet

    Hi - I'm having exactly the same problem ie HttpAddRequestHeaders returns 0.
    Did you ever find the answer?
    [email protected]


  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: wininet

    whenever an API function returns "something bad", you should call GetLastError and pass the result for FormatMessage API to get a human-readable explanation of the cause of the error.


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

Featured