Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
JHttpClient send json to rest server
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Access violation when ope...
by
Чебурашка
[
Today
at 12:14:30 pm]
Parameter passing odditie...
by
Thaddy
[
Today
at 12:11:18 pm]
Lazarus features in a non...
by
jollytall
[
Today
at 11:53:17 am]
Access violation when re-...
by
Chris Osborne
[
Today
at 11:43:49 am]
Ho Ho Ho IntraWeb in Laza...
by
irawan
[
Today
at 11:39:39 am]
FpDebug questions
by
Martin_fr
[
Today
at 11:25:02 am]
splitting an image
by
Dzandaa
[
Today
at 11:15:40 am]
how to tweek fpmake to co...
by
marcov
[
Today
at 10:35:11 am]
Can function be used for ...
by
Thaddy
[
Today
at 10:24:31 am]
Why isn't TTIRadioGroup's...
by
egsuh
[
Today
at 08:09:35 am]
Lazarus for Windows on aa...
by
Wallaby
[April 23, 2024, 11:46:56 pm]
(Solved) TIndexedAVLTree ...
by
lainz
[April 23, 2024, 10:49:03 pm]
Demo Scene Picture sinwav...
by
KodeZwerg
[April 23, 2024, 10:26:21 pm]
fkInternalCalc
by
zraja
[April 23, 2024, 09:31:07 pm]
A fairly simple sound sol...
by
KodeZwerg
[April 23, 2024, 09:23:37 pm]
add new targets to make
by
marcov
[April 23, 2024, 08:38:42 pm]
Quirky windows
by
ASerge
[April 23, 2024, 07:07:16 pm]
[Request] Demo Scene Sub ...
by
Gigatron
[April 23, 2024, 06:29:39 pm]
Unlocking Files
by
KodeZwerg
[April 23, 2024, 06:03:08 pm]
[SOLVED] trunk bug for mi...
by
Key-Real
[April 23, 2024, 05:56:32 pm]
Demo Scene Bitmap Font Sc...
by
Gigatron
[April 23, 2024, 05:56:27 pm]
Compile/Convert Delphi pr...
by
Martin_fr
[April 23, 2024, 05:43:11 pm]
Generics - correct syntax
by
Thaddy
[April 23, 2024, 05:40:59 pm]
InstallAware Using Lazaru...
by
msintle
[April 23, 2024, 05:26:36 pm]
Xcode Command Line Tools ...
by
Joseph
[April 23, 2024, 05:16:39 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: JHttpClient send json to rest server (Read 2399 times)
schumi
New Member
Posts: 43
JHttpClient send json to rest server
«
on:
May 30, 2021, 11:07:01 pm »
hi,
it's possiple to send json data (not property) to rest server with jHttpServer? I'm looking for an example
thank's
Logged
jmpessoa
Hero Member
Posts: 2302
Re: JHttpClient send json to rest server
«
Reply #1 on:
May 31, 2021, 04:53:13 am »
I found this code (in my attempts) about SOAP... maybe can help you, but I don't remember if it works ....
(and you can try some "demos": AppHttpClient****)
Code: Pascal
[Select]
[+]
[-]
procedure
TAndroidModule1
.
jButton1Click
(
Sender
:
TObject
)
;
var
clientConn
:
jObjectRef
;
begin
clientConn
:
=
jHttpClient1
.
OpenConnection
(
'http://192.168.1.3'
)
;
jHttpClient1
.
AddClientHeader
(
'Content-Type'
,
'text/xml; charset=utf-8'
)
;
jHttpClient1
.
AddClientHeader
(
'SOAPAction'
,
'"urn:OSWIntf-IOSW#Wersja"'
)
;
content
:
=
'<?xml version="1.0" encoding="UTF-8"?>'
#13
#10
+
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:OSWIntf-IOSW" '
+
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" '
+
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
+
'<SOAP-ENV:Body><ns1:Wersja/></SOAP-ENV:Body></SOAP-ENV:Envelope>'
;
jHttpClient1
.
PostSOAPDataAsync
(
content
,
'http://192.168.1.3/soap/IOSW'
)
;
end
;
«
Last Edit: May 31, 2021, 04:59:58 am by jmpessoa
»
Logged
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard
schumi
New Member
Posts: 43
Re: JHttpClient send json to rest server
«
Reply #2 on:
July 09, 2021, 06:11:51 pm »
hi,
I have try with PostSOAPDataAsync but dosn't work to send JSON to rest server.
I want to use fpHTTPclient, so I have copy fphttpclient.pp, httpprotocol.pp, httppdefs.pp in ..\jni but when call GET or POST, app crash.
What I'm wrong ?
Logged
jmpessoa
Hero Member
Posts: 2302
Re: JHttpClient send json to rest server
«
Reply #3 on:
July 09, 2021, 06:28:17 pm »
Quote
I want to use fpHTTPclient................ but when call GET or POST, app crash.
Can you send me your test project in "off" mode (by e-mail?)? so I can test your soap API and maybe I can, olso, improve the jHttpClient.....
Logged
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Operating Systems
»
Android
»
JHttpClient send json to rest server
TinyPortal
© 2005-2018