hello guyz, can you help me please if it possible ( :
i was windering of adding a cookies support in your function.. in 3.0 version...
but... i can't...
so i add a cookie string to structure description
and write some cookie condition before HttpSendRequest_ like this
Code: Select all
If *tHTTP\lSecureSocket
;
; *******************************************************************************************
; Common error anticipation/correction
; Often unnecessary but should be included for best reliability
dwBuffLen = SizeOf(dwFlags)
InternetQueryOption_(hReq, #INTERNET_OPTION_SECURITY_FLAGS, @dwFlags, @dwBuffLen)
dwFlags | #SECURITY_FLAG_IGNORE_CERT_CN_INVALID | #SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | #SECURITY_FLAG_IGNORE_REVOCATION | #SECURITY_FLAG_IGNORE_UNKNOWN_CA | #SECURITY_FLAG_IGNORE_WRONG_USAGE
InternetSetOption_(hReq, #INTERNET_OPTION_SECURITY_FLAGS, @dwFlags, dwBuffLen)
; *******************************************************************************************
;
EndIf
;
; HERE IS MY COOKIE CONDITION
;
If *tHTTP\sCookie
*tHTTP\sCookie = "Cookie: " + *tHTTP\sCookie + Chr(13) + Chr(10)
HttpAddRequestHeaders_(hReq, *tHTTP\sCookie, Len(*tHTTP\sCookie), $80000000|$20000000)
EndIf
Repeat
; *** Send Request ***
If Not HttpSendRequest_(hReq, @*tHTTP\sHeaderData, *tHTTP\lHeaderDataLen, @*tHTTP\sOptionalData, *tHTTP\lOptionalDataLen)
lIntRetVal = #PBL_ERR_INTERNET_HTTP_SEND
Break
EndIf
after that i initialize request structure like this
Code: Select all
IncludeFile #PB_Compiler_FilePath + "..\HTTPGetFromWeb30.pb"
Define tHTTP.T_PBL_HTTP_GET_FROM_WEB
tHTTP\lThreadID = 0
tHTTP\sCookie = "_ddn_intercept_2_=8f88db2768dfb1b102597762bdc9c81f"
tHTTP\sURL = "http://rutor.org"
tHTTP\lDestination = #PBL_WRITE_TO_MEMORY
HTTPGetFromWeb (@tHTTP)
Debug PeekS(tHTTP\DestBuffer,tHTTP\lTotBytesRead,#PB_UTF8)
and a result says that cookie isn't setted... the site don't gives what he have.. but in a "badpageresult" we see a correct cookie (eg. "_ddn_intercept_2_=8f88db2768dfb1b102597762bdc9c81f") which if setted site gives a full http code
i think these some kind if setted flags problem... i try to change flags in
Code: Select all
If *tHTTP\lFlags = 0 ; if flags not specified
; no popup for cookies + load from Internet (not cache)
*tHTTP\lFlags = #INTERNET_FLAG_NO_UI | #INTERNET_FLAG_NO_CACHE_WRITE | #INTERNET_FLAG_RELOAD | #INTERNET_FLAG_PRAGMA_NOCACHE
;*tHTTP\lFlags = #INTERNET_FLAG_NO_CACHE_WRITE | #INTERNET_FLAG_RELOAD | #INTERNET_FLAG_PRAGMA_NOCACHE
EndIf
but nothing changed... i tested it in curl with correct cookie it works...
thanks!