import axios from "axios";
async function customAxiosStrategy(url: string): Promise<StrategyResponse> {
const strategy = { name: "custom-axios", cost: 0 };
try {
const response = await axios.get(url, {
headers: {
"User-Agent": "Custom User Agent",
// Add other custom headers here
},
});
return {
success: true,
strategy,
html: response.data,
error: null,
status: response.status,
};
} catch (error) {
return {
success: false,
strategy,
html: null,
error,
status: error.response?.status || null,
};
}
}