[TIL] 1119 Request path contains unescaped characters

IT/TIL(Today I Learnt)|2021. 11. 19. 21:51

Today I Learnt 

 

1119

 

집에 계속 쳐박혀있으면서 코인만 보고있다.

요즘 NFT가 너무 핫한데, 나도 사야돼나 말아야돼나 고민만 몇일쨰 하고있다.

 

 

 GraphQL 서버를 다만들었다.

 

1. Mongodb를 이용한 기본적인 CRUD기능

2.  Graphql에서 naver search api 활용 

 

 

 

URl에 한국어가 있으면 

Request path contains unescaped characters가 뜬다. 

이상한게  axios에서는 뜨고 request나  node-fetch에서는 안뜬다?  axios만의 비밀인가?

URL parse?를 사용해보라는 팀장? 메니저? 사수? (사실 아직까지 뭐라고불러야할지모르겠다 그냥 이름으로불러서) 님 이 알려주신대로 찾아보다가, 더 쉬운 방법을 찾았다. 

코딩 실력이 느는것보다 옛날보다 훨신 검색을 더잘하게 되는것 같은 이느낌은 그냥 느낌이겟지...?

 

 

https://kingle1024.tistory.com/229

 

node ERR_UNESCAPED_CHARACTERS('Request path');

이유는 url의 path 부분에 치환되지 않은 문자가 들어와서 그렇다. 그래서 한글로 된 부분을 encodeURI('기업명') 으로 바꿔주면 된다. path : '/open/v3/user-chats/'+list.userChats[0].id+'/trash?botName=기업..

kingle1024.tistory.com

 

 

JSES6 화살표함수 ,

Promise 

 

https://www.youtube.com/watch?v=h33Srr5J9nY 

 

Note :  * this *  is the main reason ppl using arrow function.  

더보기
// normal function
function sum(a,b){
	return a+b
 }
 
 //arrow function
 
 let sum2 = (a,b) => {
 	return a+b
 }
 // if it just reurn you can just make it one line 
    or 
 let sum2= (a,b)=> a+b 
 
 
 // normal function 
 function isPositive(number) {
 	return number >=0
 }
 
 // arrow function
 // if the args are only one then dont need bracket 
 let isPositive2 = number => number >=0 
 
 //this is redefined in the normal function
 // if you use the arrow function => it get the original one 
 // therefore this is one of the main reaseon ppl using arrow function

 

 

 

https://www.youtube.com/watch?v=DHvZLI7Db8E 

 

더보기
// promise result => resovle or reject

let p= new Promise((resolve,reject) =>{

	let a = 1+1
    if(a == 2){
    	resolve("sucess")
    }else{
    	reject("Failed")
        }
})


// then is called when the promis result is resolved
// catch is called when the promie result is rejected 
p.then((message)=> { 
	console.log(" successful message" + message)
}).catch((message)=>{
	console.log(" failed message" + message)
    
    it can replace callback hell 
    })

 

 

 

부스터샷 백식을 맞고왓더니 좀 상태가 왔다리 갓다리하는것같다.

주말안에 할게많은데 이러면 곤란한데. 

 

반응형

'IT > TIL(Today I Learnt)' 카테고리의 다른 글

[TIL] 1123 1124  (3) 2021.11.25
[TIL] 1121 metaverse , NFT , blockchain  (4) 2021.11.21
[TIL] 1118 JS기본  (1) 2021.11.19
[TIL] 1114  (2) 2021.11.16
[TIL] 1111 AWS 자격증  (2) 2021.11.12

댓글()