You must specify a content-type
* application/x-www-form-urlencoded
* multipart/form-data; boundary=[your boundary here]
* application/json
* text/json
Since none of those are set (possibly something else, possibly
nothing set at all?) then Taffy doesn't know what to do.
You can use a proxy like Charles <http://www.charlesproxy.com/> to
July 13, 2012 7:23 PM
Very odd indeed. I'll have to code up a test for this to verify that it's working. Been slammed at work this week. Might be able to get to it this weekend.
I wonder if this is a Railo-specific issue. It's possible that under the hood ACF sees "multipart/form-data" and converts it to application/x-www-form-urlencoded (in memory, where we're looking)...
Anyway, I'll see about getting a test put together to (a) verify my install is still working, and (b) have you try it out on Railo. :)
Adam
Jean-Bernard van Zuylen wrote:
July 12, 2012 5:16 AM
Hi Adam,
The requests are coming from CFHTTP on Railo:
<cfhttp url="http://api.local:7777/me/profile/picture"
method="put"
result="pictureResult">
<cfhttpparam type="header" name="Authorization" value="Bearer 20F406E02B1261B7F0D7BDD8F5A1FF7A210C0EFF" />
<cfhttpparam type="file" name="image" file="E:\Projects\logo.png" />
</cfhttp>
This is generating the following raw content:
PUT /me/profile/picture HTTP/1.1
Authorization: Bearer 20F406E02B1261B7F0D7BDD8F5A1FF7A210C0EFF
Accept-Encoding: gzip
User-Agent: Railo (CFML Engine)
Host: api.local:7777
Content-Length: 5015
Content-Type: multipart/form-data; boundary=H7bmC6a8bexOzEXmCMjNMEMba7DbaoajoSYk
--H7bmC6a8bexOzEXmCMjNMEMba7DbaoajoSYk
Content-Disposition: form-data; name="image"; filename="logo.png"
Content-Type: image/png
Content-Transfer-Encoding: binary
The Content-Type header seems to be set correctly.
When I check the code from the release 1.1, this error is returned on line 352 in api.cfc. If I look to the code around this line, I see code handling the content types application/x-www-form-urlencoded, application/json and text/json but nothing for multipart/form-data.
Jean-Bernard
On Wednesday, July 11, 2012 9:56:58 PM UTC+2, Adam Tuttle wrote:
July 11, 2012 3:56 PM
Hi Jean-Bernard,
My first question is: How are your requests originating? Are they coming from a web-form? A native app on a mobile phone? CFHTTP? AJAX? Something else?
The error you're seeing indicates that Taffy can't tell how to decode the request. It's expecting one of the following in the Content-Type header:
- application/x-www-form-urlencoded
- multipart/form-data; boundary=[your boundary here]
- application/json
- text/json
Since none of those are set (possibly something else, possibly nothing set at all?) then Taffy doesn't know what to do.
You can use a proxy like Charles to see the raw contents of the HTTP request you're sending. That will be very helpful in debugging.
Adam
Jean-Bernard van Zuylen wrote:
Hi,
I'm trying use to upload file functionality from Taffy 1.1 but can't
make it work.
I followed what is written on the Wiki about this topic but I'm always
getting the following HTTP error:
400 You must specify a content-type. Aborting request.
I've been looking in the file api.cfc but couldn't find any code
handling the content type multipart/form-data.
Jean-Bernard
Jean-Bernard van Zuylen wrote:You must specify a content-type
July 11, 2012 9:15 AM
Ok, I pushed the new test to the *develop* branch on github. It's at
the bottom of TestCore.cfc.
To run the tests, first open /taffy/tests/ in your browser to
initialize the api, then open /taffy/tests/tests/ to run the mxunit
test suite. Of course, requires you have an /mxunit mapping or have it
in your web root.
And if you're running Railo on Tomcat, you're going to want to add the
additional servlet mapping for /taffy/tests/index.cfm/* to web.xml.
Let me know how you make out.
Adam
Adam Tuttle <mailto:ad...@fusiongrokker.com>
July 13, 2012 7:23 PM
Very odd indeed. I'll have to code up a test for this to verify that
it's working. Been slammed at work this week. Might be able to get to
it this weekend.
I wonder if this is a Railo-specific issue. It's possible that under
the hood ACF sees "multipart/form-data" and converts it to
application/x-www-form-urlencoded (in memory, where we're looking)...
Anyway, I'll see about getting a test put together to (a) verify my
install is still working, and (b) have you try it out on Railo. :)
Adam
Jean-Bernard van Zuylen wrote:
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
Adam Tuttle <mailto:ad...@fusiongrokker.com>
July 11, 2012 3:56 PM
Hi Jean-Bernard,
My first question is: How are your requests originating? Are they
coming from a web-form? A native app on a mobile phone? CFHTTP? AJAX?
Something else?
The error you're seeing indicates that Taffy can't tell how to decode
the request. It's expecting one of the following in the Content-Type
header:
* application/x-www-form-urlencoded
* multipart/form-data; boundary=[your boundary here]
* application/json
* text/json
Since none of those are set (possibly something else, possibly
nothing set at all?) then Taffy doesn't know what to do.
You can use a proxy like Charles <http://www.charlesproxy.com/> to
see the raw contents of the HTTP request you're sending. That will be
very helpful in debugging.
Adam
Jean-Bernard van Zuylen wrote:
Hi,
I'm trying use to upload file functionality from Taffy 1.1 but can't
make it work.
I followed what is written on the Wiki about this topic but I'm always
getting the following HTTP error:
400 You must specify a content-type. Aborting request.
I've been looking in the file api.cfc but couldn't find any code
handling the content type multipart/form-data.
Jean-Bernard
Jean-Bernard van Zuylen wrote:
You must specify a content-type
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
July 11, 2012 9:15 AM
Hi,
I'm trying use to upload file functionality from Taffy 1.1 but can't
make it work.
I followed what is written on the Wiki about this topic but I'm
always getting the following HTTP error:
400 You must specify a content-type. Aborting request.
I've been looking in the file api.cfc but couldn't find any code
handling the content type multipart/form-data.
Jean-Bernard
One additional thing I'll point out is that, as long as your app server (whether it's ACF, Railo, OpenBD, Smith, or something else) puts the form fields from the multi-part form into the form scope, they should all be picked up. The one possibility I see is that on non-ACF app servers the content-type may trigger the error you're talking about. If that's the case we can probably add a branch to the IF-logic that does nothing except NOT throw the error.
Adam
Adam Tuttle wrote:
Ok, I pushed the new test to the *develop* branch on github. It's at
the bottom of TestCore.cfc.
To run the tests, first open /taffy/tests/ in your browser to
initialize the api, then open /taffy/tests/tests/ to run the mxunit
test suite. Of course, requires you have an /mxunit mapping or have it
in your web root.
And if you're running Railo on Tomcat, you're going to want to add the
additional servlet mapping for /taffy/tests/index.cfm/* to web.xml.
Let me know how you make out.
Adam
Adam Tuttle <mailto:adam@fusiongrokker.com>
July 13, 2012 7:23 PM
Very odd indeed. I'll have to code up a test for this to verify that
it's working. Been slammed at work this week. Might be able to get to
it this weekend.
I wonder if this is a Railo-specific issue. It's possible that under
the hood ACF sees "multipart/form-data" and converts it to
application/x-www-form-urlencoded (in memory, where we're looking)...
Anyway, I'll see about getting a test put together to (a) verify my
install is still working, and (b) have you try it out on Railo. :)
Adam
Jean-Bernard van Zuylen wrote:
Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
Adam Tuttle <mailto:adam@fusiongrokker.com>
Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
Hi Adam,
Since I have both ACF and Railo installed on my machine (we are
migrating from ACF to Railo), I've run your test on both servers.
On ACF, GetHTTPRequestData().content returns an empty value when the
content type is multipart/form-data (apparently since ACF 8 to avoid
memory issues by keeping the uploaded file in memory). The length of
the request body is 0 and the content-type is not checked in Taffy.
Railo, on the contrary, is returning full the request body and the
content type is checked. Adding a IF-logic that does nothing as you
suggest should indeed fix the problem.
On both servers the form fields from the multi-part form are correctly
put into form scope.
JB
Le samedi 14 juillet 2012 16:03:01 UTC+2, Adam Tuttle a écrit :
One additional thing I'll point out is that, as long as your app
server (whether it's ACF, Railo, OpenBD, Smith, or something else)
puts the form fields from the multi-part form into the form scope,
they should all be picked up
The one possibility I see is that on non-ACF app servers the
content-type may trigger the error you're talking about. If that's
the case we can probably add a branch to the IF-logic that does
nothing except NOT throw the error.
Adam
Adam Tuttle wrote:
Ok, I pushed the new test to the *develop* branch on github. It's at
the bottom of TestCore.cfc.
To run the tests, first open /taffy/tests/ in your browser to
initialize the api, then open /taffy/tests/tests/ to run the mxunit
test suite. Of course, requires you have an /mxunit mapping or
have it
in your web root.
And if you're running Railo on Tomcat, you're going to want to
add the
additional servlet mapping for /taffy/tests/index.cfm/* to web.xml.
Let me know how you make out.
Adam
Adam Tuttle <mailto:ad...@fusiongrokker.com>
<mailto:ad...@fusiongrokker.com>
July 13, 2012 7:23 PM
Very odd indeed. I'll have to code up a test for this to verify
that
it's working. Been slammed at work this week. Might be able to
get to
it this weekend.
I wonder if this is a Railo-specific issue. It's possible that
under
the hood ACF sees "multipart/form-data" and converts it to
application/x-www-form-urlencoded (in memory, where we're
looking)...
Anyway, I'll see about getting a test put together to (a) verify my
install is still working, and (b) have you try it out on Railo. :)
Adam
Jean-Bernard van Zuylen wrote:
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
<mailto:jbvan...@hotmail.com>
Adam Tuttle <mailto:ad...@fusiongrokker.com>
<mailto:ad...@fusiongrokker.com>
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
<mailto:jbvan...@hotmail.com>
July 11, 2012 9:15 AM
Hi,
I'm trying use to upload file functionality from Taffy 1.1 but
can't
make it work.
I followed what is written on the Wiki about this topic but I'm
always getting the following HTTP error:
400 You must specify a content-type. Aborting request.
I've been looking in the file api.cfc but couldn't find any code
handling the content type multipart/form-data.
Jean-Bernard
Adam Tuttle <mailto:ad...@fusiongrokker.com>
July 13, 2012 8:04 PM
Ok, I pushed the new test to the *develop* branch on github. It's
at the bottom of TestCore.cfc.
To run the tests, first open /taffy/tests/ in your browser to
initialize the api, then open /taffy/tests/tests/ to run the
mxunit test suite. Of course, requires you have an /mxunit
mapping or have it in your web root.
And if you're running Railo on Tomcat, you're going to want to
add the additional servlet mapping for /taffy/tests/index.cfm/*
to web.xml.
Let me know how you make out.
Adam
Adam Tuttle <mailto:ad...@fusiongrokker.com>
July 13, 2012 7:23 PM
Very odd indeed. I'll have to code up a test for this to verify
that it's working. Been slammed at work this week. Might be able
to get to it this weekend.
I wonder if this is a Railo-specific issue. It's possible that
under the hood ACF sees "multipart/form-data" and converts it to
application/x-www-form-urlencoded (in memory, where we're looking)...
Anyway, I'll see about getting a test put together to (a) verify
my install is still working, and (b) have you try it out on Railo. :)
Adam
Jean-Bernard van Zuylen wrote:
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
Adam Tuttle <mailto:ad...@fusiongrokker.com>
Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
> <mailto:jbvanzuylen@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
> <mailto:jbvanzuylen@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvanzuylen@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
> <mailto:jbvan...@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
> <mailto:jbvan...@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>
> Jean-Bernard van Zuylen <mailto:jbvan...@hotmail.com>