Tiago Hillebrandt
2015-05-06 17:07:02 UTC
Hey guys,
I am implementing a test API using the Basic HTTP Authentication provided
by @auth_basic.
That said, when I call the API sending wrong credentials, it returns this
output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Error: 401 Unauthorized</title>
<style type="text/css">
html {background-color: #eee; font-family: sans;}
body {background-color: #fff; border: 1px solid #ddd;
padding: 15px; margin: 15px;}
pre {background-color: #eee; border: 1px solid #ddd; padding:
5px;}
</style>
</head>
<body>
<h1>Error: 401 Unauthorized</h1>
<p>Sorry, the requested URL <tt>xxx</tt>
caused an error:</p>
<pre>Access denied</pre>
</body>
</html>
Thus, what I would like to know is: is there a way to convert these errors
output to JSON instead of HTML?
Thanks in advance
--
I am implementing a test API using the Basic HTTP Authentication provided
by @auth_basic.
That said, when I call the API sending wrong credentials, it returns this
output:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Error: 401 Unauthorized</title>
<style type="text/css">
html {background-color: #eee; font-family: sans;}
body {background-color: #fff; border: 1px solid #ddd;
padding: 15px; margin: 15px;}
pre {background-color: #eee; border: 1px solid #ddd; padding:
5px;}
</style>
</head>
<body>
<h1>Error: 401 Unauthorized</h1>
<p>Sorry, the requested URL <tt>xxx</tt>
caused an error:</p>
<pre>Access denied</pre>
</body>
</html>
Thus, what I would like to know is: is there a way to convert these errors
output to JSON instead of HTML?
Thanks in advance
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.