json request in post method is not working. pls help!

89 views
Skip to first unread message

prashant roy

unread,
Sep 25, 2016, 3:15:56 AM9/25/16
to Taffy Users

1. POST method is working perfectly FOR XML  and its returning required xml

<cfhttp url="http://api.dev.prashant.com/v1/rest/rule.xml" method="post" >
   <cfhttpparam type="formfield" name="onix" value=xnrawonix>
   <cfhttpparam type="HEADER" name="X-prashant-API-Key" value="api-test"/>
</cfhttp> 


2.  POST method is NOT working when calling as JSON

<cfhttp url="http://api.dev.prashant.com/v1/rest/rule.json" method="post" >
   <cfhttpparam type="formfield" name="onix" value=xnrawonix>
   <cfhttpparam type="HEADER" name="X-prashant-API-Key" value="api-test"/>
</cfhttp> 




prashant roy

unread,
Sep 25, 2016, 3:17:58 AM9/25/16
to Taffy Users
I am including error text for more details. 

object of java.io.ByteArrayOutputStream
Class Namejava.io.ByteArrayOutputStream
Methods
MethodReturn Type
close()void
reset()void
size()int
toByteArray()byte[]
toString(java.lang.String)java.lang.String
toString(int)java.lang.String
toString()java.lang.String
write(int)void
write(byte[], int, int)void
writeTo(java.io.OutputStream)void

Adam Tuttle

unread,
Sep 25, 2016, 7:08:12 AM9/25/16
to Taffy Users
That's not the error text, that's a java class wrapping the error text. Change <cfdump var="#error#" /> to <cfdump var="#error.toString()#" />

Adam

--
You received this message because you are subscribed to the Google Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ρräshȁnϯ RṏY

unread,
Sep 25, 2016, 7:11:13 AM9/25/16
to taffy...@googlegroups.com
thank you for response. 

we saw your one post. it solved the case. thank you very much. 

--
You received this message because you are subscribed to a topic in the Google Groups "Taffy Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/taffy-users/khOyFu08ui4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to taffy-users+unsubscribe@googlegroups.com.

prashant roy

unread,
Sep 25, 2016, 7:12:04 AM9/25/16
to Taffy Users
thank you very much!

I saw your reply in one of the post by Ray. it solved our problem

Adam

To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages