Спасибо Netspirit за компоненты для протокола HTTP.
Add(MainForm,2953706,98,63)
{
Width=533
Height=398
Caption="HTTPClient - заголовки и параметры"
Position=1
}
Add(Button,12479344,42,273)
{
Left=10
Top=75
Width=140
Height=25
Caption="Отправить"
link(onClick,5102370:doEvent1,[])
}
Add(Memo,2568247,448,455)
{
Left=5
Top=110
Width=505
Height=240
ScrollBars=3
}
Add(Message,363691,259,518)
{
Caption="Ошибка запроса"
Icon=1
}
Add(DoData,7347341,259,455)
{
link(onEventData,9377522:doEvent1,[])
link(Data,2427935:getVar,[])
}
Add(Hub,9377522,329,455)
{
InCount=2
OutCount=1
link(onEvent1,2568247:doAdd,[])
}
Add(Hub,5102370,98,273)
{
OutCount=5
link(onEvent1,5349095:In,[(133,279)(133,188)])
link(onEvent2,12400571:In,[(144,286)(144,209)])
link(onEvent3,16059263:doString,[])
link(onEvent4,2416370:doCharset,[(143,300)(143,342)])
link(onEvent5,6023390:doLoadString,[(127,307)(127,489)])
}
Add(LineBreakEx,2427935,259,427)
{
Caption="head"
Type=2
}
Add(LineBreakEx,15402714,189,546)
{
Caption="head"
Type=3
link(_Data,6023390:RawHeaders,[])
}
Add(Edit,4213360,175,238)
{
Left=50
Top=7
Width=360
Text="[TOKEN]"
}
Add(HTTPClient,6023390,175,483)
{
Method=1
FieldCharset=1
Point(RawHeaders)
Point(Headers)
Point(PostData)
link(URL,16059263:FString,[])
link(onHeadersAvail,7347341:doData,[(233,489)(233,461)])
link(onFinish,9377522:doEvent2,[(307,496)(307,468)])
link(onError,363691:doMessage,[(223,510)(223,524)])
link(PostData,3646196:Text,[(202,394)(629,394)])
AddHint(-73,52,44,13,Method)
AddHint(-73,73,40,13,FieldCharset)
}
Add(Label,10388595,574,77)
{
Left=10
Top=10
Width=35
Height=17
Caption="Токен"
}
Add(Label,5959088,574,126)
{
Left=10
Top=32
Width=40
Height=17
Caption="Chat ID"
}
Add(Label,11035557,574,175)
{
Left=10
Top=52
Width=34
Height=17
Caption="Текст"
}
Add(Edit,10915450,238,238)
{
Left=50
Top=29
Width=200
Text="[Chat_ID]"
}
Add(Charset,2416370,343,336)
{
Type=6
link(onCharset,1045388:doString,[])
link(Text,13149642:Text,[])
}
Add(FormatStr,16059263,175,287)
{
DataCount=1
Mask="https://api.telegram.org/bot%1/sendMessage"
Point(FString)
link(onFString,4474186:doString,[])
link(Str1,4213360:Text,[])
}
Add(Edit,13149642,343,238)
{
Left=50
Top=49
Width=200
Text="Hello Мир!"
}
Add(StrList,3646196,623,287)
{
}
Add(FormatStr,4474186,238,287)
{
DataCount=1
Mask="chat_id=%1"
Point(FString)
link(onFString,1157673:doWork,[])
link(Str1,10915450:Text,[])
}
Add(FormatStr,1045388,399,336)
{
DataCount=1
Mask="text=%1"
Point(FString)
link(onFString,9538539:doWork,[])
}
Add(LineBreak,10710295,525,336)
{
Caption="clear.post"
link(Out,3646196:doClear,[(604,342)(604,300)])
Primary=[12400571,-350,-133]
}
Add(LineBreakEx,1157673,455,287)
{
Caption="post"
}
Add(LineBreakEx,15722200,546,287)
{
Caption="post"
Type=1
link(OnEvent,3646196:doAdd,[])
}
Add(LineBreak,225895,357,469)
{
Caption="clear.head"
link(Out,2568247:doClear,[(435,475)(435,468)])
Primary=[5349095,-182,-287]
}
Add(LineBreakEx,9538539,455,336)
{
Caption="post"
}
Редактировалось 1 раз(а), последний 2020-07-16 20:06:12