Support the ongoing development of Laravel.io →
posted 10 years ago
Testing
Last updated 2 years ago.
0

Hi

I have been trying to do the same thing with TestCase sub-classes, attempting to set the content type to application/xml when calling $this->action(...) in an effort to simulate POST requests from an external application which only handles XML data. Instead, I am getting the form-urlencoded type instead.

Have you had any luck resolving this? Trying to find someone else with this issue has only turned up this post!

Thanks

R

Last updated 2 years ago.
0

Hi

I think I found it. It took a bit of digging around in the Symfony API, but I've had success with the following: ['CONTENT_TYPE' => 'application/xml'] for the $server parameter. Line 370 sets the value of CONTENT_TYPE to 'application/x-www-form-urlencoded' if it has not been set.

Hope this helps, if you are still looking.

R

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

eviljosh eviljosh Joined 6 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.