import { axiosInstances } from "./axiosInstanc"interface upladPdfPayload { name: string; pdf: File}export const uploadPdfApi = async (payload: upladPdfPayload) => { try { console.log(payload); const res = await axiosInstances.post('/pdf/upload', payload); return res.data; } catch (error: any) { return error.response.data; }}
value in consolename: 'Resarch paper certificate.pdf', pdf: File}name: "Resarch paper certificate.pdf"pdf: FilelastModified: 1713083292691lastModifiedDate: Sun Apr 14 2024 13:58:12 GMT+0530 (India Standard Time) {}name: "Resarch paper certificate.pdf"size: 937460type: "application/pdf"webkitRelativePath: ""[[Prototype]]: File[[Prototype]]: Object
axiosInstance
import axios from "axios";import { baseUrl } from "./baseUrl";function getToken() { return localStorage.getItem("token");}export const axiosInstances = axios.create({ baseURL: baseUrl, headers: { authorization: `Bearer ${getToken()}` }})axiosInstances.interceptors.request.use((config) => { config.headers.authorization = `Bearer ${getToken()}`; return config;});
I try everytning check console and network tabe , but unable to solve it , i want to see pdf in network tab in payload