Yes, this is possible. However, it won’t work always if you are trying to access a URL on the same computer. This is the case if you use the same FileMaker Pro Client for the Web Companion and Troi URL Plug-in.
Yes, you can use the TURL_SetCookies function to set the cookies text on Mac OS. On Windows cookies are handled natively by the operating system, so this function does not do anything on this platform.
See also the example files in the URL Plug-in download for more information.
When the same command works on Mac but not on Windows this probably has to do with the encoding. On Windows the default header is “application/x-www-form-urlencoded” and on Mac “NotEncoded” is the default. When your Post works on Mac but not on Windows, please try adding (on Windows) the switch -NotEncoded to the Post function, like this:
TURL_Post ( "-NotEncoded" ; theURL ; theData )
When your Post works on Windows but not on Mac, you should (on Mac) first set a custom header:
TURL_SetCustomHeader ( "-unused" ; "Content-Type: application/x-www-form-urlencoded" )
and then do the TURL_Post step.
The plug-in uses the certificates that the OS has installed.
With the URL plug-in you can also post forms that have radio buttons or checkboxes in it.
Say you have this web page with a FORM on it:
<HTML> <HEAD> <TITLE>Test Form</TITLE> </HEAD> <BODY> <P>TEST</P> <FORM ACTION="/cgi-sys/formmail.pl" METHOD=POST> <P><INPUT TYPE=checkbox NAME=checkbox1 VALUE=value1 CHECKED>checklabel</P> <P><INPUT TYPE=radio NAME=myradio VALUE=radiovalue1>radiolabel 1 <INPUT TYPE=radio NAME=myradio VALUE=radiovalue2>radiolabel 2</P> <P>input data:<INPUT TYPE=text NAME=field1 VALUE="" SIZE=32><BR> <INPUT TYPE=submit NAME=Submit VALUE="Submit for Processing"></P> </FORM> </BODY> </HTML>
This FORM has a checkbox, 2 radio buttons and an input field.
In the POST data you only include the checkbox if it is checked. Otherwise leave it out. When you add it, add the name, in this case “checkbox1”, an equals sign and the value, here “value1”.
So in the case above you add: “checkbox1=value1” for this checked box.
For a radiobutton you include the value of the radiobutton that is selected. In this example “myradio”, an equals sign and the value of the chosen radiobutton, here “radiovalue2”.
Putting it together you need to send this as the POST data (the 3rd parameter):
NOTE Spaces are not allowed, so you need to encode these as %20. Also other higher ASCII characters need to be encoded. You can use the TURL_ToHTTP function of the plug-in to do this.
If your question is not answered here, please look in the documentation that comes with the plug-in. If you have suggestions please email a FAQ suggestion.