MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / fetchNetkbData

Function fetchNetkbData

web/scripts/ragnar_modern.js:14033–14049  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14031
14032async function postPwnAPI(endpoint, payload = {}) {
14033 const response = await fetch(endpoint, {
14034 method: 'POST',
14035 headers: {
14036 'Content-Type': 'application/json'
14037 },
14038 body: JSON.stringify(payload)
14039 });
14040
14041 let data = null;
14042 try {
14043 data = await response.json();
14044 } catch (error) {
14045 data = null;
14046 }
14047
14048 if (!response.ok || (data && data.success === false)) {
14049 const errorMessage = data && (data.error || data.message)
14050 ? (data.error || data.message)
14051 : `Request failed (${response.status})`;
14052 throw new Error(errorMessage);

Callers 2

loadNetkbDataFunction · 0.70
refreshNetkbDataFunction · 0.70

Calls 5

errorMethod · 0.80
networkAwareFetchFunction · 0.70
showNetkbErrorFunction · 0.70
updateNetkbStatisticsFunction · 0.70
displayNetkbDataFunction · 0.70

Tested by

no test coverage detected