Client with http-server [message #1866807] |
Fri, 07 June 2024 01:16 |
Dustin Schmitt Messages: 15 Registered: April 2024 |
Junior Member |
|
|
Hello
I want to get and push parameters to a http-server . I build forte from source and activated http=on.
Sadly it's not actually working. My main problem is to set up the id right.
At the moment I only get NO_SOCKET or INVALID_ID as status
Can someone give me one example for get and one for push.
I'm also not sure if I have a bug.
Or are there another common mistakes.
In my test I just tried to read strings from the server.
Thank you all
Dustin
[Updated on: Fri, 07 June 2024 01:24] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Client with http-server [message #1866852 is a reply to message #1866843] |
Sun, 09 June 2024 09:12 |
|
From the 4diac FORTE output I assume that you are using the develop branch for 4diac FORTE. AFAIR Monika did some improvements on the HTTP layer for that. She also updated and fixed the documentation. The new documentation can be found here: https://github.com/eclipse-4diac/4diac-documentation/blob/main/src/communication/http.adoc
This new documentation is also already part of the 4diac IDE documentation. However not yet on the web page. The reason for that is that we are currently reworking the web-page and changing the documentation on the old on is not really worth it.
PS: We are always happy for any support on improving our documentation.
|
|
|
Re: Client with http-server [message #1866933 is a reply to message #1866852] |
Tue, 11 June 2024 05:25 |
Dustin Schmitt Messages: 15 Registered: April 2024 |
Junior Member |
|
|
I used now the develop version of forte. I also created a client_3_2 (3SD and 2RD). I was able to create a GET-communication with my server.
But the POST and PUT-requests doesn't work at the moment.
I created a Server who accepts all types of requests GET/POST/PUT. It worked if I did a curl request.
POST-request: curl -X POST http://localhost:8000/daten -H "Content-Type: application/json" -d "{\"name\": \"John\", \"alter\": 30, \"verheiratet\": true, \"haustiere\": [\"Hund\", \"Katze\"]}"
PUT-request: curl -X PUT http://localhost:8000/daten -H "Content-Type: application/json" -d "{\"name\": \"John\", \"alter\": 30, \"verheiratet\": false, \"haustiere\": [\"Hamster\"]}"
My main issue is that the json-data not correctly arrives. Some data is arriving certified trough the line: Empfangene Daten erhalten -b' '
But not the right one.
I can't copy my curl -body (json-string) directly because I would need double qoutes around my wstring-body, but every double quotes around e.g. "name" causes an issue.
With single quotes and backslashes I'm getting the same result.
I added in the files my used python http-server, my post & put request and my client configuration.
Thanks for your help
Dustin
|
|
|
|
|
|
Re: Client with http-server [message #1867023 is a reply to message #1866999] |
Wed, 12 June 2024 13:47 |
|
Thx for the feedback. If you have ideas how the documentation can be improved feel free to change it and submit a pull request. The great advantage of our new AsciDoc format and github is that you can directly edit the file on github and contribute your suggestion as PR.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07964 seconds