Dynamic parameters for a CFHTTP POST request
I need to call a service CFHTTP (Post), but the parameters passed to the function are dynamic, so there is no way to create a static list of tags CFHTTPPARAM. In fact, there are a few static parameters, but there will always be dynamic parameters that are included in the query based on the values set for the static settings.My question is how to pass form data in a POST CFHTTP query when the parameters that should be passed are not known in advance? I see that there is a type attribute of the CFHTTPPARAM of 'head' and 'body' tag, so I thought that it would be possible to manually build the data that are passed, but what is the right way to pass parameters to form if I build the 'head' and 'body' data myself?
What is the problem with the dynamic
Tags: ColdFusion
Similar Questions
-
Dynamic parameters RESTful Service by POST method.
Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
Currently the RESTful in post method Service have 2 static parameters such as P1 and P2.
for example
BEGIN
INSERT INTO INSERT_TABLE (LOG_DESC, LOG_ID)
VALUES(:P1,:P2);
COMMIT;
END;
How to pass several parameters in the HTTP call when the parameter is unknown? Dynamic parameter is possible?
Thank you
MINDMAP thanks for your quick response. I must have misunderstood you. Please go through my description of the issue update. I created another question thread link is https://community.oracle.com/message/12612734#12612734
Thank you
-
vCenter Orchestrator HTTP API: POST request error 400 1032
I'm trying to start a workflow via a POST request to the vCenter Orchestrator API. When I run the same workflow with a GET request, there is no problem and I get the following result in the localhost_access_log.current_date.txt:
[src_ip_address] - [13/Oct / 2015:04:46:00 + 0000] "GET vco/api/flux/af83cf34-6a00-45b5-946e-0d44ece508bb/exécutions/HTTP/1.1" 200 272
However, when I run a POST with the following parameters:
restMethod: POST
restEndpoint: https://[dest_ip_address]:8281
restPath: / vco/api/workflows/af83cf34 - a 6, 00-45 b 5 - 946e - 0d44ece508bb/executions /
user: [username]
content: {"parameters": [{'name': 'name1', 'type': 'string', 'value': {'chain': {"value": "Value1"}}, 'field': 'local'}]}
contentType: application/json
accept: application/json
I have the following error in localhost_access_log.current_date.txt:
[src_ip_address] - [13/Oct / 2015:03:53:39 + 0000] "POST vco/api/flux/af83cf34-6a00-45b5-946e-0d44ece508bb/exécutions/HTTP/1.1" 400 1032
And the output on the client side:
{Success = no, ResponseHeader = {null = HTTP/1.1 400 Bad Request, Server = Apache-Coyote/1.1 Content-Length = 1032, Content-Language = EN, connection = closed, Date-Wed, 13 Oct 2015 Message = Bad Request, ReasonPhrase is Bad Request, StatusCode = 400}}
I'm in vCenter Orchestrator 5.5. There is no output to the server.log file. I didn't have a chance, researching the 400 1032' error number. [dest_ip_address] is HTTPS. Can anyone help clarify this?
The command line below seems to work for me using the cmd terminal Windows:
curl u - ikv name h ' Accept: application/json ' h ' Content-Type: application/json "d" {\"parameters\":[{\"value\":{\"string\":{\"value\":\"value1\"}},\"type\":\"string\",\"name\":\"name1\",\"scope\":\"local\" "}]}" x POST https://ip_address:8281/vco/api / stream/af83cf34-6a00-45b5-946e-0d44ece508bb/executions
Note that the double quotes inside the body of the request are preceded by the backslash character.
-
CFHTTP post to AWS S3 works CF9 but fails to CF10
I use the Infrastructure Canvas API to download files. After the initial call to the API, Web returns information that is used to make a POST request to the S3 Amazon Web Services service to transfer a file.
This is the application that I use to post the file on AWS S3, populated with the data returned by the API of the canvas:
<cfhttp url="#aws.upload_url#" result="result" method="post" multipart="yes"> <cfhttpparam type="formfield" name="key" value="#aws.upload_params.key#" /> <cfhttpparam type="formfield" name="acl" value="#aws.upload_params.acl#" /> <cfhttpparam type="formfield" name="Filename" value="#photoName#" /> <cfhttpparam type="formfield" name="AWSAccessKeyId" value="#aws.upload_params.AWSAccessKeyId#" /> <cfhttpparam type="formfield" name="Policy" value="#aws.upload_params.Policy#" /> <cfhttpparam type="formfield" name="Signature" value="#aws.upload_params.Signature#" /> <cfhttpparam type="formfield" name="Content-Type" value="#aws.upload_params['content-type']#" /> <cfhttpparam type="formfield" name="success_action_redirect" value="#aws.upload_params['success_action_redirect']#" /> <cfhttpparam type="file" name="file" file="#fullPath#" /> </cfhttp>
This application runs on a ColdFusion 9 server (the response returns '200 OK'), but fails on a server ColdFusion 10 (the response returns "500 Internal Server Error"). The canvas API call works in both cases.
Ideas or suggestions appreciated.
I put the attribute redirect cfhttp on 'no' on versions CF9 and CF10. In both cases, S3 returns a 303 response with a URL code in a location on the ground that looks similar (only identifiers specific to the file in the query string are different).
My current solution is to leave the redirect attribute to "no" (no and send a third HTTP request to get the location of the redirect (which in this case includes a variety of metadata about the successful download).)
Thanks to Peter and Petro for the suggesstions.
-
Dynamic CRM2011 for the outlook client does not recognize that I have already installed SP2
Dynamic CRM2011 for server (vista 64-bit) or the outlook client does not recognize that I have already installed SP2
Error log (edited to highlight what appears to be the problem):Latest Version of the OS: 6.0.600111:14:06 | Info | Service Pack: Service Pack 111:14:06 | Info | System type: workstation11:14:06 | Info | Mask away: 0 x 030011:14:06 | Error | Failed to install Microsoft Dynamics CRM for Outlook. Install Windows Vista Service Pack 2 and then try again.11:14:06 | Error | System requirements not filled to allow the installer to run.My computer works SP2 and all current updates except for:- Platform Update for Windows Vista x 64-based Systems (KB971644)
- error: 8000ffff
I ran 'fit' the Microsoft tool, but made no difference. This update is my problem, or I am barking the wrong tree?Help, please!Hi Paul,.
The question you posted would be better suited in the Forums of Microsoft Dynamics. I would recommend posting your query in the Forums of Microsoft Dynamics.
-
Unable to see the parameters required/required in a request competing
Hi all
In one of the forums to my place, we are unable to see thecompulsory/mandatory parameters r in the concurrent requests, as I see them as highlighted with a yellow ish color.
When I press F11 for query programs simultaneously and other things like the users security search > user > Define, again I do not see the field program concurrent name or username yellow turn after I press F11.
I've attached screenshots for your reference. The purple one is what I am facing the problem with. Red E looks normal as it should.
I searched a lot for any profile Option or anything else to fix this, but I couldn't find anything. You could help me with this?
Thank you
Prasad
Hi all
Finally I found this. I hope that the changes I have made are correct.
FND: Indicator colors
Valid values are Yes (default), No, or null. When this profile option is set to Yes:
- Required fields are displayed in yellow.
- Queryable fields are displayed in a different color in query mode enter.
- Read-only fields are rendered in dark grey.
I made this change to the color RED as the instance 'FND: indicator colors"has been set to 'NO'."
And now I see that it has changed its colors. Please see the pictures below:
And the simultaneous requests Phase and status changed, too:
Thank you all for your help.
Best,
Prasad
-
POST requests have failed by deployed/used app, gets is OK but
Recently, my implementation faces a problem with sending of POST requests, when I run the browser all my queries work very well. When I try to do a POST through the emulator of the ripple, phonegap app on the device, or a built apk, they will fail and I get no information about the exception. I know that my endpoint is fine because A. It works in the browser and B. I can raise requests in fiddler all day without problem. This leads me to believe it's a matter of phonegap, what I had before where I had to update the CLI version and miraculously, he started to work again... This time I've updated 6.1.0 6.3.0 and no luck...
The application uses Angular1 and sends the MESSAGE via $http.
I have the plugin list white and everything set as allow in the config.xml file
< name of the ditch: plugin = "cordova-plugin-whitelist" source = "MNP" / >
< allow navigation href = "" * "/ >"
< access origin = "" * "/ >"
< allow intention href = "" * "/ >"
Here's what I got when I tried to log the exception, first line is a handmade journal when the error was caught, second line is the error that was taken... aka nothing.
[phonegap] [console.log] Exception occurred while inserting the mobile user record
[phonegap] [console.log] {}
Any help is appreciated.
Issue in the browser seems intent... That is 100% my fault, I didn't have a script in source for angular-local-storage. However, the 503 error is always produced by ripple and it seems that my Android becomes a completely different error.
Ripple using 503 error displays in the console that phonegap is served.
Using my Android device - no newspaper is connected to the console - but the alert began my error $http function
------------------------------
a little later since I have actually never posted ^ ^ ^
If the first cause of all it was a problem with MY code. No PhoneGap. However, ripple still exposes the strange 503 even when I have both the browser and the Android operation. I have no idea why its happening and that sucks because the ripple is really a nice place to debug to except if I something is misconfigured, who, like this post, can attest, is entirely possible.
-
Send the POST request with BLOB content
Hello
I usually use the following structure to send the POST request with content of varchar2 and numbers
content := '{"Original File Name":"'||V_HOMEBANNER_1_EN_NAME(indx)||'"}'; url := 'https://api.appery.io/rest/1/db/Names'; req := utl_http.begin_request(url, 'POST',' HTTP/1.1'); UTL_HTTP.set_header(req, 'X-Appery-Database-Id', '5f2dac54b02cc6402dbe'); utl_http.set_header(req, 'content-type', 'application/json'); UTL_HTTP.set_header(req, 'X-Appery-Session-Token', sessionToken); utl_http.set_header(req, 'Content-Length', LENGTH(content)); utl_http.write_text(req, content); res := utl_http.get_response(req); BEGIN LOOP utl_http.read_line(res, buffer); END LOOP; utl_http.end_response(res); EXCEPTION WHEN utl_http.end_of_body THEN utl_http.end_response(res); END;
And it works very well. However, now I want to send/download (jpg image) files a blob in a MongoDB collection called "Files" (so url: = ttps://api.appery.io/rest/1/db/files). The guide of the collection is the next loop as a general advice:
curl -X POST \ -H "X-Appery-Database-Id: 5f2dac54b02cc6402dbe" \ -H "X-Appery-Session-Token: <session_token>" \ -H "Content-Type: <content_type>" \ --data-binary '<file_content>' \ https://api.appery.io/rest/1/db/files/<file_name>
But I couldn't translate this curvature in PL/SQL query. Specifically, the part (-given binary '< file_content >")
I have these BLOB files in an Oracle table, and they are stored with their names as follows:
File_name File_content PIC_1.jpg BLOB OBJECT PIC_2.jpg BLOB OBJECT PIC_3.jpg BLOB OBJECT My question, how to download these images in the target URL?
After a few hours I spent on it, I got it working. My solutions is inspired by this http://blog.optiosys.com/?p=246
Since you must send you no the (same) CLOB and BLOB files, you need just need to replace .write_text by .write_raw.
Here is my part of work for your reference:
content: = V_HOMEBANNER_1_EN (indx); -blob
file_name: = 'test.jpg ';
URL: = "https://api.appery.io/rest/1/db/files/": file_name;
Req: = utl_http.begin_request (url, 'POST', ' HTTP/1.1');
Utl_http.set_header (req, 'X-Appery-database - Id', '53fae4b02cc4021dbe');
Utl_http.set_header (req, 'X-Appery-Session-token', sessionToken);
Utl_http.set_header (req, "content-type', ' image/jpeg");
req_length: = DBMS_LOB.getlength (CONTENT);
DBMS_OUTPUT. Put_line (req_length);
-IF YOU LIMIT THE DATA UNDER 32KB MSG:
IF req_length<=>=>
THEN
Start
Utl_http.set_header (req, "Content-Length", req_length);
Utl_http.write_raw (req, content);
exception
while others then
DBMS_OUTPUT. Put_line (SQLERRM);
end;
-IF MSG DATA MORE THAN 32 KB
ELSIF req_length > 32767
THEN
BEGIN
DBMS_OUTPUT. Put_line (req_length);
Utl_http.set_header (req, "Transfer-Encoding", "Chunked");
While (offset<>
LOOP
DBMS_LOB. Read (content, amount, offset, buffer);
Utl_http.write_raw (req, buffer);
offset: = offset + amount;
END LOOP;
exception
while others then
DBMS_OUTPUT. Put_line (SQLERRM);
end;
END IF;
l_http_response: = UTL_HTTP.get_response (req);
Utl_http.READ_TEXT (l_http_response, response_body, 32767);
Utl_http.end_response (l_http_response);
I hope this helps. Good luck
-
I can't load up a book cover of my images for a web site request form
I can't load up a book cover of my images for a web site request form. Is there a method to do this?
Hello
This can depend on the configuration of the web site form. If can accept only text, may have a limit on the maximum characters lol, etc. Some Web site forms do not accept entries stuck, just live by typing.
I suggest you contact the website for advice.
-
Where to find the ability auto-raccordement on a router for PPPoE linsys for ADSL connection on request?
Hello
Use Linksys router information questions.
Look for the router of the link exact model number.
http://homesupport.Cisco.com/en-us/support?ICID=global-header-support-link
See you soon.
-
Help with JSON HTTP Post request
Still fairly new to QT so I try to send a query with some json http post, I'm pulling the json to a file and which seems to work fine but I get a http 500 error. I want to just make sure that my code is correct before contacting the company that webservice I use here is my code:
JsonDataAccess jda; QVariant list = jda.load(QDir::currentPath() +"/app/native/assets/jsonData/myjson.json"); qDebug()<
- post(request, list.toByteArray());
I have a feeling that I'm passing in json data in the wrong post method. Any help is appreicated
Hello
You send an empty server string because list.toByteArray () returns an empty string.
You must save the QByteArray list;
QByteArray result; jda.saveToBuffer(list, &result); // and then QNetworkReply *reply = networkAccessManager->post(request, result);
or
Simply load the json with QFile file
QFile file(YOUR_JSON); if (!file.open(QIODevice::ReadOnly)){ qDebug() << Q_FUNC_INFO << file.errorString(); return; } QByteArray result = file.readAll(); file.close() QNetworkReply *reply = networkAccessManager->post(request, result);
Hoe it helps
-
I'm looking for an old post by a specific member.
I'm looking for an old post by a specific member.
Gary
Find the user name in the section you are looking for the answer. If she has been "answered" you can also go to their profile and search manually (tedious)
-
Dynamic action for button update region
Hi all, how to create a dynamic action for button update region. Suggest me
Thank you
Apex-Obin wrote:
Thank you... with over loading the entire page?
Updating of dynamic actions using partial page refresh (PPR). However it is supported only on certain types of region: traditional and interactive reports, graphics and plug-ins where PPR support has been implemented by the developer of plug-in. The model of the region must also include an id = "" #REGION_STATIC_ID # "attribute, which means that the model region cannot set model No."
-
Dynamic lists for recommendation using CSElement
Hello
I want to know what should be in CSElement to create dynamic lists for recommendation.
If I create just a list with two columns as asset Id and the type of assets that will suffice?
Dynamic list recommendations requires a list named "
AssetList
" and 2 columns 'assetid' and 'assettype.We can use any method to generate this list.
Looks like my CSElement
I used the most basic that is hard coding as
And it works.
Thanks nice to point me the finger in the right direction.
-
Dynamic action for validation of date with the notification message plugin
Hi all
Someone help me please with dynamic action for validation of date with the message notification plugin. I have a form with two elements of the date picker control and message notification plugin.
The requirement first user selects the exam is finished and then selects the date. So, if the date is greater than the date of the examination is over + 2 years then doesn't trigger the message notification plugin. I tried to create that dynamic action on the date picker date that triggers the scheduled issue notification message but I want to make conditional, I mean displays the message only if date of the selected is greater than the date of the exam is finished more than 2 years.
In terms simple, notification is displayed only if provided is superior to (date of the exam is completed + 2 years).
I use oracle apex 4.0 version and oracle 10g r2 database. I tried to reproduce the same requirement in my personal workspace. Here are the details. Please take a look.
Workspace: raghu_workspace
username: orton607
password: orton607
APP # 72193
PG # 1
Any help is appreciated.
Thanks in advance.
Orton.
You can get the value of the date of entry:
$(ele) .datePicker ('getDate');
So what to add functions such as:
function validateNotification (d1, d2) {}
Date1 var = $(d1) .datepicker ('getDate');
date2 var = $(d2) .datepicker ('getDate');
if(date1 && date2) {}
return ((date2.getTime()-date1.getTime())/(1000*24*60*60))>(365*2);
} else {}
Returns false;
}
}
The logic based on setting (I have two years from years of 365 days preceding)
Then in the D.A. specify a JavaScript expression as:
validateNotification ('P2_REVIEW_COMPLETED', this.triggeringElement.id)
Refer to page 2 for example.
Maybe you are looking for
-
Tecra M11-107 and i7-940XM compatibility
Hi, I want to improve my laptop Tecra M11-107 for the fastest processor this socket can work. Can someone tell me if the i7-940XM processor is compatible?
-
I can't burn my DVDs, why?
Hello!I created a film editing photos with windows movie maker, and when I want the most serious on a dvd with windows DVD Creation, engraving is interrupted always in the same place, about 4% of the engraving, and a message appears: "error specified
-
HelloI would like to help.I have the following problem: Site studies Web has an application that runs on top of JWPlayer plugin (SWF), but the site is by permission of lists all the rules of content filtering with the firewall for full access, and ye
-
Hello. I had a problem with my PC and I need to reformat and reload the operating system. Before that, I had saved my data. After I rebuilt the OS, I installed the Palm from the CD software I got with my Palm TX. When he tried to synchronize for
-
BlackBerry Smartphones Desktop Manager does not recognize Blackberry 9650