Необходимо из Delphi отправить POST-запрос на LiveJournal.com. Я написал такой код:
| Код | procedure TForm1.Button1Click(Sender: TObject); var Post: TStrings; begin IdHTTP1.Request.URL := 'www.livejournal.com'; IdHTTP1.Request.Method := hmPost; IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded'; Post := TStringList.Create; Post.Add('mode=postevent&user={username}&auth_method=clear&auth_response=&allowmask=&auth_challenge=&password={pass}&lineendings=pc&year=2006&mon=05&day=14&hour=11&min=10&subject=test&event=Testtesttest'); IdHTTP1.Request.ContentLength := Length(Post.Strings[0]); Edit4.Text := IdHTTP1.Post('http://www.livejournal.com/interface/flat', post); end;
|
Однако в ответ я получаю такое сообщение:
| Цитата | errmsg Client error: No username sent. success FAIL
|
В чем проблема? Зараннее благодарен. |