Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

post request with headers

const createPostRequest = async () => {
	try{
		const { data } = await axios.post(url, body_data, {
		   headers: {
	    	 'Authorization': `Basic ${token}`
		   },
		})
    
	    console.log(data)
	} catch (error) {
		console.log(error)
	}
}

createPostRequest();
Comment

PREVIOUS NEXT
Code Example
Javascript :: js add html element 
Javascript :: javascript select element with two classes 
Javascript :: react semantic button 
Javascript :: javascript speech recognition 
Javascript :: ndjson to json javascript 
Javascript :: get selected text input javascript 
Javascript :: js date to timestamp 
Javascript :: how to enable emit on react in vs code 
Javascript :: angular ionic capacitor nfc reader 
Javascript :: validate form on submit 
Javascript :: readfilesync buffer 
Javascript :: how to check if input is checked javascript 
Javascript :: setstate array 
Javascript :: javascript get magnitude of number 
Javascript :: react useMemo to render a list 
Javascript :: online python to c converter 
Javascript :: clear form inside modal after close reactjs 
Javascript :: object check null or empty 
Javascript :: javascript read consol input 
Javascript :: graphql query 
Javascript :: javascript check for duplicates in array 
Javascript :: command to run nextjs project 
Javascript :: Sequelize.Op; 
Javascript :: sequelize raw query 
Javascript :: jquery multiple ids same funjquery apply function to multiple elementsction 
Javascript :: How to convert a canvas to an image javascript 
Javascript :: how to use if else inside jsx in react 
Javascript :: black adam 
Javascript :: how to make alert in javascript 
Javascript :: emacs change text size 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =