cfhttp

Convert an image from CFHTTP filecontent to binary data with Coldfusion

对着背影说爱祢 提交于 2019-12-17 16:50:58
问题 I'm trying to convert an image (jpg) loaded via cfhttp to binary data. I can't use cffile action="readBinary" as it is not a local file. 回答1: Here's how I handle this, and I use this to grab and process hundreds of images a day with ColdFusion 8. <cfhttp timeout="45" throwonerror="false" url="http://domain/image.jpg" method="get" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12" getasbinary="yes" result="local.objGet" > <cfset local

CFHTTP - Read data from URL transferring in chunks

微笑、不失礼 提交于 2019-12-14 01:24:09
问题 I am trying to get a file from a URL using cfhttp but it seems that the provider is sending the data in chunks. <cfhttp method="get" url="https://www.test.com/somefile.xml"> </cfhttp> The response header is having Transfer-Encoding as chunked and is missing Content-Length . Also, the statusCode is 200 Ok but the FileContent is showing " Connection Failure ". Any suggestions? 回答1: Finally, I used java.net.URL to get this working: <cfset local.objURL = createObject( "java" , "java.net.URL" )

The request has exceeded the allowable time limit Tag: cfhttp

你。 提交于 2019-12-12 11:09:25
问题 I am facing this issue on a daily basis. I am having an application which Catches the huge data from various applications in the nightly schedule jobs through a cfhhtp call/request. The problem here is that it calls the 'extensive list of scopes' to catch the data, and unfortunately we cannot limit the scopes :( The timeout set in the Task is 9000 seconds(which already is quite high), but still it says timeout at cfhttp tag "The request has exceeded the allowable time limit Tag: cfhttp". I

cfhttp in cfloop limit? use cfthread

风格不统一 提交于 2019-12-12 05:11:55
问题 I'm currently trying to develop an API and the stage where I'm at just now is to populate a table with a full data set (ID, first name, last name, dob etc). The way I've written this is to use a cfloop from 1 to 500,000 (as I don't know what range the IDs range from and to) and within each cfloop I call a function that makes a cfhttp request to the server and retrieve the content. I then deserialize the returned JSON, call a function to query my table to see if the current item ID already

CFNetwork HTTP timeout?

做~自己de王妃 提交于 2019-12-11 17:43:47
问题 I am looking for a way to add a timeout to a CFHTTP request. It seems like there should be a feature of the CFHTTPMessage or the CFReadStream object, but I can't find it. Do I have to roll my own timer on the run loop or something? (if so, any code for this?) Thanks! 回答1: My answer is outdated but I can't delete the accepted answer. 回答2: Try this, readStream is your CFReadStreamRef: #define _kCFStreamPropertyReadTimeout CFSTR("_kCFStreamPropertyReadTimeout") double to = 15; // 15s timeout

Create Wufoo webhook with PUT request in ColdFusion

[亡魂溺海] 提交于 2019-12-11 07:31:47
问题 I'm having troubles with building correct PUT request to the Wufoo. In all my attempts I see the same error: 404 A WebHook must contain a url parameter. Here is the version with JSON data type: <cfset local.action = "forms/#local.formHash#/webhooks.json" /> <cfset local.request = {"url" : local.webHookURL, "handshakeKey" : local.webHookKey} /> <cfset local.request["handshakeKey"] = local.webHookKey /> <cfhttp url="#local.baseURL##local.action#" method="put" username="#local.apiKey#" password=

Trying to convert JSON HTTP post to CFHTTP post

孤街浪徒 提交于 2019-12-11 05:45:49
问题 I am trying to properly code a call to the Firebase Cloud Messaging REST API though CFHTTP, by recreating the output of successful Firebase console post. Below is what the console states is the proper code POST /fcm/send HTTP/1.1 Host: fcm.googleapis.com Content-Type: application/json Authorization: key=AIzcXE cache-control: no-cache { "to": "e5kpn8h9bR95NuXVHTOi50bCURG0BS4S6ccUm3X5q", "priority": "high", "notification" : { "title": "", "body" : "This is the actual message content", "sound":

ColdFusion 10 - CFHTTP - Random peer not authenticated on SSL calls (cacerts file updated)

徘徊边缘 提交于 2019-12-11 04:55:47
问题 We have 9 ColdFusion 10 servers running version 10,0,13,287689. We've added the correct certificates to the cacerts file for java version being using by ColdFusion. Our CFHTTP SSL calls will work correctly for a while, then suddenly they will start returning peer not authenticated. The will not work agian until the ColdFusion instance is recycled at which point they work until the fail again. There is no information in the coldfusion-out, coldfusion-error, http, or exception ColdFusion logs

CFHTTP Over SSL

非 Y 不嫁゛ 提交于 2019-12-11 03:27:46
问题 I'm trying to retrieve files from a server over SSL using the ColdFusion CFHTTP tag with no success. Our environment is Linux using the Server Configuration. The keystore used is at cf_root/runtime/jre/lib/security/cacerts . I retrieved X.509 certificate (in DER format) from the target server and exported it to a file. On our server, in the folder where cacerts resides, I imported this cert into our cacerts keystore: keytool -import -alias certAlias -file pathToX509Cert -keystore cacerts

How to access a variable name in ColdFusion that contains a special character

笑着哭i 提交于 2019-12-11 02:15:00
问题 For example I have the following bit of code: <cfhttp url="FileURL" method="get" result="HTTPResult" timeout="5" /> And I want to do this: <cfoutput> #HTTPResult.ResponseHeader.content-type# </cfoutput> However ColdFusion will see the dash - as an operator and try to subtract variables "HTTPResult.ResponseHeader.content" from "type", and neither exists. Is there a direct way to access the "content-type" variable or do I need to jump through hoops to fetch it out of the header variable? 回答1: