tracy icon indicating copy to clipboard operation
tracy copied to clipboard

BlueScreen HTTP Request: Add support for rendering PHP Input

Open janbarasek opened this issue 5 years ago • 4 comments

  • new feature
  • BC break? yes

If request was called as ajax json payload with some data but without 'Content-Type': 'application/x-www-form-urlencoded' header, Tracy can not dump sent values.

This change add automatic detection of PHP Input and render to HTTP request section.

Example:

Snímek obrazovky 2019-11-01 v 12 12 52

If entered data was short json, Tracy will detect it automatically and dump as array for bette readability.

More information (Czech language): https://php.baraja.cz/ajax-post

Thanks.

janbarasek avatar Nov 01 '19 11:11 janbarasek

Hi it's nice feature but this "JSON detection" is very dumb. I think it would be better to detect JSON using content type (application/json).

lukaspijak avatar Nov 01 '19 11:11 lukaspijak

You cannot simple use file_get_contents('php://input'), because the output may be too large.

JanTvrdik avatar Nov 01 '19 16:11 JanTvrdik

Thanks to everybody.

@lukaspijak Added detection by HTTP header Content-Type which must starts with application/json. For example: application/json;charset=UTF-8

@JanTvrdik Added limitation for 10000 input characters.

janbarasek avatar Nov 02 '19 16:11 janbarasek

+1

KminekMatej avatar Oct 04 '23 09:10 KminekMatej