2017-11-20 3 views
0

나는 증명을위한 여권을 가지고있다. 내 응용 프로그램에서 HTTP 요청에 Urdl enter link description here을 사용합니다.http post url with passport authentication

하지만

urdl::istream is; 
is.set_option(urdl::http::request_method("POST")); 
is.set_option(urdl::http::request_content_type("text/plain")); 
is.set_option(urdl::http::request_content("username=test&password=test")); 
host = urdl::url::from_string(http://some/path, ec); 
is.open(host); 

Urdl

으로 사용자 이름과 암호를 전달하고자하지만 나에게 (400) 내가 곱슬 곱슬와 시도 나쁜 요청을 제공

curl -X POST --data "username=test&password=test" http://some/path 

그것은 작동하고, I 좋은 대답을 받았습니다.

그래서 나는 Urdl에 무엇이 잘못되었는지 모릅니다.

답변

0

콘텐츠 유형이 text/plain이 아니라 application/x-www-form-urlencoded입니다.