0
RestClient를 사용하여 게시물에 사용자 이름과 암호를 보내려면 어떻게해야합니까? 내 클라이언트 코드는 다음과 같습니다 :RestClient를 사용하여 사용자 이름과 암호를 보내는 방법
response = RestClient.post 'http://localhost:3000/api/rules',
:name => "me", :password => "12345",
:books => {:book_name => "Harry Porter",
:author => "JR"}
서버 코드가 레일에와`http_basic_authenticate_with 사용한다 : 이름 => "나": 암호 => "12345"를.
당신은 URL 문자열에 사용자 이름과 암호를 추가 할 수 있습니다