Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFHTTP request to YouTube return 408 Request Time-out errors

New Here ,
Sep 27, 2023 Sep 27, 2023

I am using CFHTTP to test for broken links. For some reason all youtube links return 408 Request Time-out error. Simply increasing the timeout value does not make any difference. Some other servers show the same behaviour.

 

Is there anything I can do to make it correctly detect if the link is OK? Maybe it requires a specific header to be sent with the request?

 

Here is the function I use:

<cffunction name="checkLink" access="remote" returnType="struct" returnFormat="json" output="no">
    <cfargument name="link" type="string">
    <cfset ret = structNew()>
    <cfhttp url="#link#" method="head" timeout="1">
    <cfset ret["code"] = cfhttp.statusCode>
    <cfset ret["detail"] = cfhttp.errorDetail>
    <cfreturn ret>
</cffunction>

 

These are some of the links that return the error:


Thank you!

123
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2023 Sep 30, 2023
LATEST

I don't know why CFHTTP would get that error, but I would compare the request and response headers from CFHTTP to something else you know works (wget, curl). Because this is encrypted with TLS (HTTPS), you'll need to use a proxy that will let you get access to all the requests and responses. Fiddler will let you do that, and I think you can get a free or trial version still.

 

https://www.telerik.com/fiddler

 

If you have to use a trial version, be prepared for nonstop sales calls.

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources