Imagine the following scenario: your clients visit the website (let’s imagine this one) and see anything but the expected result. The normal reaction is to call you (at the most inappropriate time) and ask you to fix it ASAP, because they’re losing money.
How can we help the user report the bug as accurately as possible?
The bug
Let’s have a really simple JSON request and an error to be able to reproduce our case:
$json_data = '{"value":1,"apples":2,"name":3,"oranges":4,"last one":5}';
//we will simulate the json data, but imagine that this is the normal data exchanged daily between your client’s website and a 3rd party API
$ch = curl_init('http://talkweb.eu/labs/fr/json_callback.php');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json',
'Content-Length: ' . strlen($json_data)));
//the normal CURL request, nothing strange here:
$result = curl_exec($ch);
//receiving the data back
$f_data = json_decode($result,true);
//showing a greeting with the output
echo “Welcome”. $f_data['username'];
If you visit the test website now, you will notice that there’s a problem.
Continue reading %Implement Client-side Bug Reporting with UserSnap%
more
{ 0 comments... » Implement Client-side Bug Reporting with UserSnap read them below or add one }
Post a Comment