![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Конвертирование пост-данных. [D6]
Hm.. © (2005-08-25 00:33:00)Какими ф-иями можно реализовать следующее:
1) Convert spaces to a + sign.
2) Convert everything else to %hh where hh is the hex representation of the character's ASCII value.
Все это мне нужно для передачи паст-данных типа
"mode=login&user=test&password=test"
Piter (2005-08-25 01:59:00) [1]О, я кажется телепатически стал догонят.
Уважаемый, кодировать надо строку запроса, а не весь HTTP заголовок :))))
Piter (2005-08-25 01:57:00) [2]hm... (25.08.05 1:52) [2]
POST+%2Finterface%2Fflat+HTTP%2F1%2E0%0D%0AHost%3A+www%2Elivejournal%2Ecom%0D%0AContent%2Dtype%3A+application%2Fx%2Dwww% 2Dform%2Durlencoded%0D%0AContent%2Dlength%3A+34%0D%0A%0D%0Amode%3Dlogin%26user%3DBLA%26password%3Dsdf%21wre%40%0D%0A%0D% 0A
какую-то ты фигню понаписал.
hm... (25.08.05 1:52) [2]
почему получается так, что данные вида
при посылке ничего не возвращают
данные не могут ничего возвращать. Это ДАННЫЕ.
hm... (2005-08-25 01:52:00) [3]А почему получается так, что данные вида
POST+%2Finterface%2Fflat+HTTP%2F1%2E0%0D%0AHost%3A+www%2Elivejournal%2Ecom%0D%0AContent%2Dtype%3A+application%2Fx%2Dwww% 2Dform%2Durlencoded%0D%0AContent%2Dlength%3A+34%0D%0A%0D%0Amode%3Dlogin%26user%3DBLA%26password%3Dsdf%21wre%40%0D%0A%0D% 0A
при посылке ничего не возвращают..
Piter (2005-08-25 01:05:00) [4]
function EncodeContent(const msg : String) : String;
var
I : Integer;
begin
Result := '';
for I := 1 to Length(msg) do begin
if msg[I] = ' ' then
Result := Result + '+'
else if msg[I] in ['a'..'z', 'A'..'Z', '0'..'9'] then
Result := Result + msg[I]
else
Result := Result + '%' + IntToHex(ord(msg[I]), 2);
end;
end;