Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Error Message "found txt/html but expected text/xml&quo |
|
Author |
|
db
Joined: 25 Jun 2012 Posts: 5 Location: Canada, Vancouver
|
Posted: Fri 06 Jul '12 19:31 Post subject: Error Message "found txt/html but expected text/xml&quo |
|
|
Hi Experts,
I am getting this error from a module I wrote for Apache:
"Client found response content type of "txt/html", but expected "text/xml"
I use the module so my device can communicate with my database. The device expects XML format but Apache has experienced an error and fires html response to it, so device does not understands it and shows "Client found response content type of "txt/html", but expected "text/xml". So, the error could really mean anything.
My question is
Is there a way to somehow have Apache throw a customizable XML response to an error rather than sending error in HTML format? That way my device would understand it and would show real error instead of showing "Client found response content type of "txt/html", but expected "text/xml".
I am inexperienced with Apache, please provide thorough explanation how to do it or what could I do to solve the issue.
Much appreciated |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Sat 07 Jul '12 21:25 Post subject: |
|
|
It can be done by adding AddType to an extension of your files. e.g.
AddType text/xml .xhtml
or changing the default Type
DefaultType text/xml |
|
Back to top |
|
db
Joined: 25 Jun 2012 Posts: 5 Location: Canada, Vancouver
|
Posted: Mon 09 Jul '12 0:11 Post subject: |
|
|
Hi James and thanks for your reply.
Would you mind explaining bit more since I am new to Apache?
Is AddType or DefaultType something to be added in httpd.conf file or?
Much appreciated. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 09 Jul '12 9:08 Post subject: |
|
|
Yes both are to be added to the httpd.conf. For more information I made both to links to the documentation from apache in the post above.
DefaultType --> apache sends anything what is not different defined somewhere else as the specified format (header).
AddType --> add a type to an extension. |
|
Back to top |
|
db
Joined: 25 Jun 2012 Posts: 5 Location: Canada, Vancouver
|
Posted: Mon 09 Jul '12 16:39 Post subject: |
|
|
James Blond wrote: | Yes both are to be added to the httpd.conf. For more information I made both to links to the documentation from apache in the post above.
DefaultType --> apache sends anything what is not different defined somewhere else as the specified format (header).
AddType --> add a type to an extension. |
Thanks James,
I will give it a read and try it. Hopefully that will at least provide a more specific error than simply throwing "Client found response content type of "txt/html", but expected "text/xml", so I can investigate for the real cause.
Much Appreciated. |
|
Back to top |
|
|
|
|
|
|