@app.route('/scans/<int:scan_id>/traffic/<int:traffic_id>', methods=['GET'])
@requires_auth
def get_traffic_details(scan_id, traffic_id):
 scan_info = get_scan_info_from_id(scan_id)
 if (scan_info is None):
  abort(404, 'Scan not found')
 history_db = HistoryItem()
 try:
  details = history_db.read(traffic_id)
 except DBException:
  msg = 'Failed to retrieve request with id %s from DB.'
  abort(404, msg)
  return
 data = {'request': b64encode(details.request.dump()), 'response': b64encode(details.response.dump())}
 return jsonify(data)

@ app . route ( '/scans/<int:scan_id>/traffic/<int:traffic_id>' , methods = [ 'GET' ] ) @ requires_auth def get_traffic_details ( scan_id , traffic_id ) : scan_info = get_scan_info_from_id ( scan_id ) if ( scan_info is None ) : abort ( 404 , 'Scan not found' ) history_db = HistoryItem ( ) try : details = history_db . read ( traffic_id ) except DBException : msg = 'Failed to retrieve request with id %s from DB.' abort ( 404 , msg ) return data = { 'request' : b64encode ( details . request . dump ( ) ) , 'response' : b64encode ( details . response . dump ( ) ) } return jsonify ( data )
the http request and response associated with a vulnerability .