Miva, Miva Script, Miva Empresa, Miva Mia amd Miva Merchant are registered trademarks of the Miva Corporation
 
Ivo Truxa - truXoft control systems: advanced programming and custom IT solutions home / about / webdesign / Miva / automation / contact

http://mivo.truxoft.com
MIVO!
miva beyond limits

 

MIVA®  RESOURCES:  Changing MvCALL HTTP headers

by Ivo Truxa, 09/22/2000 (posted to the Miva-User-List)


When accessing external URLs, you can send faked HTTP headers inclusive cookies, user agent, referrers, 'accept' strings, or whatever else with plain Miva. Well, you will not find it in the documentation, but it is a very easy and useful trick. An example that follows, sends a cookie to a server requesting it. It may be useful if the server accepts requests from cookie-enabled browsers only. In the same way, through MvCALL, you could suggest the server that you are accessing it with any agent (browser):

<MvASSIGN NAME="crlf" VALUE="{asciichar(13) $ asciichar(10)}">
<MvCALL ACTION="{'http://domain/path/doc.ext HTTP/1.0' $ crlf
  $ 'Cookie: htscallerid=IamFakedMivaCallerID!;' $ crlf
  $ 'Accept: '
 }" METHOD="get">

Explanation: Miva sends the string you put in the ACTION field without any modifications - it just appends 'HTTP/1.0' and two CR/LF after it. If you put your own HTTP header (inclusive cookie or whatever else) and append something that the next 'HTTP/1.0' (appended automatically by Miva) does not disturb some of more touchy servers, it works perfectly. I used 'Accept: ' in the example, but you can try anything else (you might put no terminating string as well) - it should work too.


top

HTTP header example

Few examples of usual HTTP directives that you can attach to the MvCALL ACTION string:

Accept: */*
Referer: http://truxoft.com/kurzy/index.htm
Accept-Language: cs
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (incompatible; MSIE -99.99; Windows 84)
Host: www.hey.com
Connection: Keep-Alive
You could also suggest that Miva is able to use HTTP/1.1, but I cannot guarantee what happens if the server really sends some HTTP/1.0 incompatible response.

top

Some Useful Links

List of RFC's
RFC-1945: Hypertext Transfer Protocol - HTTP/1.0
RFC-2068: Hypertext Transfer Protocol - HTTP/1.1 (obsolate)
RFC-2616: Hypertext Transfer Protocol - HTTP/1.1
RFC Editor
Search the RFC Database

 

top

   

Miva and some other terms used on this page are registerd trademarks of the Miva Corporation
copyright  truXoft  © 1997-2012