415 Unsupported Media Type

64 views
Skip to first unread message

Anurag Bandhu

unread,
Apr 28, 2020, 2:58:21 PM4/28/20
to cherrypy-users
Right now Unsupported Media Type is showing Error code 500 Internal Server Error, in cherryPy.
Whereas I want to generate error code 415.

Sviatoslav Sydorenko

unread,
Apr 29, 2020, 5:26:39 AM4/29/20
to cherryp...@googlegroups.com
Do you have any proof?

--Sviatoslav.

Sent from my phone, please pardon any typos.

вт, 28 квіт. 2020, 20:58 користувач Anurag Bandhu <anuragb...@gmail.com> пише:
Right now Unsupported Media Type is showing Error code 500 Internal Server Error, in cherryPy.
Whereas I want to generate error code 415.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cherrypy-users/1cd741a5-88d7-413f-86be-901785f7d0d2%40googlegroups.com.

Anurag Bandhu

unread,
Apr 29, 2020, 6:37:43 AM4/29/20
to cherryp...@googlegroups.com
Hi Sviatoslav,
Thank you for the reply,
Currently with my cli in cherryPy Web server, I generate this request:
`curl -X POST "http://localhost:11000/api/auth/check" -H "accept: */*" "Content-Type: application/json" -d "{\"token\":\"string\"}"`
returns:
`{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "a0e6df91-37f7-4d08-83a8-cbc7ab677a91"}                                                                                                                                                                                                                                                                                                                        curl: (3) URL using bad/illegal format or missing URL
`
Which is not correct, it misguide the users. I want to update the error code from 500 Internal Server Error to 415 Unsupported Media Type. I am unable to figure out what might be the issue, I am quite new with cherryPy.

Thank you and Regards,
Anurag

Michiel Overtoom

unread,
Apr 29, 2020, 7:53:35 AM4/29/20
to cherryp...@googlegroups.com

Hi Aurug,

> `{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "a0e6df91-37f7-4d08-83a8-cbc7ab677a91"}

This is typically caused by an exception in your webapp code, not necessarily in CherryPy itself. Probably the log will show you a backtrace which shows you where the error occured. Without seeing the actual server code it's hard to guess what's going wrong.

Greetings,

--
"You can't actually make computers run faster, you can only make them do less." - RiderOfGiraffes

Anurag Bandhu

unread,
Apr 29, 2020, 9:49:03 AM4/29/20
to cherrypy-users
Was able to resolve the issue by tools.json_in.force': False -> True


On Wednesday, 29 April 2020 16:07:43 UTC+5:30, Anurag Bandhu wrote:
Hi Sviatoslav,
Thank you for the reply,
Currently with my cli in cherryPy Web server, I generate this request:
`curl -X POST "http://localhost:11000/api/auth/check" -H "accept: */*" "Content-Type: application/json" -d "{\"token\":\"string\"}"`
returns:
`{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "a0e6df91-37f7-4d08-83a8-cbc7ab677a91"}                                                                                                                                                                                                                                                                                                                        curl: (3) URL using bad/illegal format or missing URL
`
Which is not correct, it misguide the users. I want to update the error code from 500 Internal Server Error to 415 Unsupported Media Type. I am unable to figure out what might be the issue, I am quite new with cherryPy.

Thank you and Regards,
Anurag

On Wed, 29 Apr 2020 at 14:56, Sviatoslav Sydorenko <w...@sydorenko.org.ua> wrote:
Do you have any proof?

--Sviatoslav.

Sent from my phone, please pardon any typos.

вт, 28 квіт. 2020, 20:58 користувач Anurag Bandhu <anuragb...@gmail.com> пише:
Right now Unsupported Media Type is showing Error code 500 Internal Server Error, in cherryPy.
Whereas I want to generate error code 415.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages