Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   8.6    Statistic  

CURL.GetRedirectURL

Get the URL a redirect would take you to if you would enable CURL.SetOptionFollowLocation.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes
MBS( "CURL.GetRedirectURL"; curl )   More

Parameters

Parameter Description Example value
curl The CURL session handle. $curl

Result

Returns the requested value or nothing on error.

Description

Get the URL a redirect would take you to if you would enable CURL.SetOptionFollowLocation.
This can come very handy if you think using the built-in libcurl redirect logic isn't good enough for you but you would still prefer to avoid implementing all the magic of figuring out the new URL.

Examples

Do not follow, but return redirect URL:

# Start new session
Set Variable [ $curl ; Value: MBS("CURL.New") ]
# Set URL to load
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL) ]
# RUN now
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
# Check result
Set Field [ CURL Test::Text ; MBS("CURL.GetResultAsText"; $curl; "UTF8") ]
Set Field [ CURL Test::newURL ; MBS("CURL.GetRedirectURL"; $curl) ]
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugAsText"; $curl) ]
# Cleanup
Set Variable [ $result ; Value: MBS("CURL.Cleanup"; $curl) ]

See also

Example Databases

Created 18th August 2014, last changed 24th May 2017


CURL.GetRedirectTime   -   CURL.GetRequestSize

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins