Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
support the same functionality as Fiddler on the QM?
#1
The same function as the "Get" Fiddler does Qm of support from?
[Image: file.php?mode=view&id=703&sid=6dc9805d23...4cc98c9779]
Referer: htttp://www.xxxx.com/contents
send URl Get headers?

and The same function as the from "JS string" Fiddler does Qm of support from?
[Image: file.php?mode=view&id=704&sid=6dc9805d23...4cc98c9779]


Attached Files Image(s)
       
#2
QM internet functions currently don't allow to specify additional headers to send. It will be added in next QM version.
Now you can use this function:
Member function Http.Get3
Code:
Copy      Help
function# $remotefile str&data [flags] [inetflags] [str&responseheaders] [$headers] ;;flags: 1-3 cache flags, 16 download to file, 32 run in other thread

;Downloads web page or other file.
;Returns: 1 success, 0 failed.

;remotefile - file to download, relative to server. Examples: "index.htm", "images/earth.jpg".
;data - variable that receives file data. If flag 16 - variable that contains local file name.
;flags, inetflags, responseheaders, headers - see <help>IntGetFile</help>. Does not support flags: 4, 8. For https use INTERNET_FLAG_SECURE in inetflags.

;REMARKS
;At first call Connect to connect to web server.

;See also: <IntGetFile>
;Added in: QM 2.3.2.


if(flags&0x10000) goto g1 ;;thread

if(!Cache(flags inetflags)) ret

if(flags&0x10000=0) if(m_dlg or flags&32) ret Thread(1 &remotefile "Downloading" remotefile)
;g1
__HInternet hi=HttpOpenRequest(m_hi "GET" remotefile 0 0 0 inetflags 0); if(!hi) ret Error
if(!HttpSendRequest(hi headers -1 0 0)) ret Error
if(&responseheaders and !GetResponseHeaders(hi responseheaders)) ret Error
ret Read(hi data flags&16)

;note: HttpOpenRequestW does not support Unicode too.
example
Macro Macro2560
Code:
Copy      Help
out
str s
Http h.Connect("www.quickmacros.com")
h.Get3("index.html" s 0 0 0 "Referer: http://www.quickmacros.com")
out s
#3
Member function str.EscapeJavascript
Code:
Copy      Help
function$ [flags] ;;flags: 1 escape ' instead of ", 2 escape Unicode characters to \uXXXX

;Replaces JavaScript string special characters to escape sequences.
;Returns self.

;EXAMPLE
;str s="a '' ' \ [] [8][9][11][12] ąﻟ"
;s.EscapeJavascript(2)
;out s


if(!this.len) ret
findreplace("\" "\\")
if(flags&1) findreplace("'" "\'"); else findreplace("''" "\''")
findreplace("[]" "\r\n")
findreplace("[8]" "\b")
findreplace("[9]" "\t")
findreplace("[10]" "\n")
findreplace("[11]" "\u000B")
findreplace("[12]" "\f")
findreplace("[13]" "\r")

if flags&2 and findrx(this "[\x80-\xff]")>=0
,BSTR b=this; int i j
,str s.all(b.len*6 2)
,for i 0 b.len
,,if(b[i]<128) s[j]=b[i]; j+1
,,else s.set(F"\u{b[i]%%04X}" j); j+6
,s.fix(j); this.swap(s)

ret this

See also UnescapeJavascript:
Javascript function inquiry
#4
Thank u for your help!
I'm hopping for next version program.
substitute(original word)for(js string), input one by one?
#5
Quote:substitute(original word)for(js string), input one by one?
:?:


Forum Jump:


Users browsing this thread: 1 Guest(s)