2017-03-22 3 views
0

AppleScript 요청에 컬링 요청을 보내고 있습니다. "house, dog, plant"라는 텍스트로 데이터를 보냅니다. 그러나, 내 노드 서버에서 방금 읽은 : "집"데이터가있는 Curl POST 및 Express가있는 노드 서버

어떤 아이디어? 감사!

하여 Applescript : 익스프레스

set testText to "house,dog,plant" 

     do shell script "curl -X POST -d words=" & testText & " http://localhost:3000/comments" 

노드 서버 :

exports.getSlideComments = 함수 (REQ, 입술) {

console.log("ENTERED POST"); 

console.log (req.body.words); // It just prints house 

res.send('200'); 

};

+0

[내 대답은] (http://stackoverflow.com/questions/42956648/curl-post-with-data-and-node-server-with-express/42957622#42957622) 도움이 되었습니까? – rsp

답변

0

Node 프로그램이 데이터가 application/x-www-form-urlencoded 일 것으로 기대하기 때문입니다.

쉼표 대신 %2C을 사용해보세요.