Menu

#2 CURLOPT_HTTPHEADER help needed

open
nobody
None
9
2006-01-12
2006-01-12
planev
No

Hi

I want to simulate a browser and send custom requests
to the server. Below is PHP code:

$myHeader = array( "Accept-Encoding: gzip,
deflate",
"Accept:
image/gif, image/x-xbitmap,".
"image/jpeg,
image/pjpeg, */*",
"Accept-
Language: en-us",
"User-Agent:
Mozilla/4.0 (compatible;".
"MSIE5.01;
Windows NT)",
"Connection:
Keep-Alive");
curl_setopt($ch, CURLOPT_HTTPHEADER,
$myHeader);

How can do that with VB? Here is my attempt:

Dim arHeaders(1) As String

arHeaders(0) = "Accept -Encoding: gzip , deflate"
arHeaders(1) = "Accept-Charset: ISO-8859-1,utf-
8;q=0.7,*;q=0.7"

vbcurl_easy_setopt easy, CURLOPT_HTTPHEADER,
arHeaders(0)
'Passing Arrays to a DLL Procedure [MSDN HELP
PAGE]
'If you pass the first element of an array to
a DLL procedure,
'that DLL then has access to all of the
array's elements.

When I execute the curl line, VB crashes...

Discussion

  • planev

    planev - 2006-01-12
    • priority: 5 --> 9
     
  • Alex Bermudez

    Alex Bermudez - 2010-08-25

    I have the same issue. VB6 chashes when i trying to execute "vbcurl_easy_setopt easy, CURLOPT_HTTPHEADER, arHeaders(0) ". Does anyone have a fix for this bug?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.