Go Back > Forum > BB Language Forums > Deutsches Forum

User login

Frontpage Sponsor


Does BaanBoard need a new forum entry for Questions related to Extensions / ION Interfacing: BOD and BDE?
Why Bother, nobody reads here ...
Just drop all the questions in the Tools Development forum
Extensions are a different ball-game: they need a new forum entry
ION Interfacing - BOD and BDE is a different ball-game: they need a new forum entry
Just create two different forums and see what will happen...
What are you talking about? Something new? Leave things as they are!
Total votes: 17

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 26th July 2021, 14:11
MS-Tech MS-Tech is offline
Join Date: Dec 2015
Posts: 68
MS-Tech is on a distinguished road
Baan: 6 - DB: SQL-Server - OS: Windows 7
Baan: Infor ERP 10.5

Hallo Zusammen,

ich möchte eine REST Api über den HTTP Client anbinden. Aktuell würde ich gerne via PUT oder PUSH Daten zu versenden. In der Hilfe ist leider nur ein GET Beispiel enthalten und ich weiß einfach nicht, wie ich die zu sendenden Daten als JSON-Objekt bzw. JSON-String mitzugeben.

Beispiel aufbau JSON-Objekt:
| JSON erstellen
json.item = Json.newObject()
Json.setString(json.item, "DataA", "")
Json.setString(json.item, "DataB", "")
Json.setString(json.item, "DataC", "")
Json.setString(json.item, "DataD", "")
Danach schreibe ich das JSON-Objekt in einen String, um diesen dann über den HTTP-Client an die API zu übergeben.

| JSON in String schreiben
Json.writeString(json.item, json.text)
Im Anschluss daran rufe ich meine Methode auf, um dann den Request abzusezten.

| REST Schnittstelle aufrufen und JSON Text mitgeben
if not httpclt.put(strip$(l.url), json.text, l.error)
Die Funktion sieht folgendermaßen aus:

function boolean http.put(const string i.url, string, ref string errormsg())
	long	response
	long	statuscode
	string	statustext(128)
	long	curlcode
	long	bodystream
	long	jsonvalue
	|* Perform an HTTP PUT request
	response = http.put(	i.url,

	|* Get the HTTP status code; for example:
	|* 200 [HTTP_STATUS_OK] means the request was processed successfully
	|* 400 [HTTP_STATUS_BAD_REQUEST] means the request was not understood
	|* 500 [HTTP_INTERNAL_SERVER_ERROR] means the server encountered an error while processing
	statuscode = http.response.statuscode(response)

	|* Get an HTTP status text, like "OK", "Bad Request", "Internal Server Error" etc.
	statustext = http.response.statustext(response)

	if statuscode <> 200
	or trim$(statustext) <> "OK" then
		errormsg = statustext

	|* Cleanup, this will also delete the HTTP headerlist; also the body stream is closed
Ich weiß nur absolut nicht, ob die Datenübergabe in der Funktion http.put(..) so funktioniert (siehe fett markierter Bereich).

Hat jemand von euch einen Tipp?

Viele Grüße
Reply With Quote
Old 26th July 2021, 17:11
bdittmar's Avatar
bdittmar bdittmar is offline
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,928
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7/D.3 - DB: tbase, ms-sql7, oracle10gV1, 11g, 12c, 19c - OS: HP-UX, W2K3, SLES, RHLE


lt. Hilfe.
#include <bic_httpclt>

function long http.put  (const string url,  ...)


Sends a PUT HTTP request to a URL.

const string url the URL to send the request to
 ... see http.send() for more information. 
Return values
an http.response object; check the response object for information about whether the request succeeded 

This function is implemented in the 4GL Tools and can be used in all script types. This function is available from TIV level 2120. 

passed number of arguments must be valid 
passed argument types must be valid 
passed attributes/flags must be known 
Related topics

HTTP Client overview 
HTTP Client synopsis
Reply With Quote
Sponsored Links

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Functions Not Supported in LNUI Arlina Tools Development 7 30th October 2020 08:45
Baan client disconnects after 10 minutes on VPN connection pjohns Tools Administration & Installation 3 20th September 2018 18:21
Webtop Webhelp 8.5 Client Issues toolswizard Tools Administration & Installation 4 30th March 2009 23:53
Can't Connect Via Baan Client - Error 1326 Wade Kuhl Tools Administration & Installation 5 29th October 2007 15:43
Launching a BW client avpatil Tools Development 6 23rd September 2004 08:50

All times are GMT +2. The time now is 16:38.

©2001-2021 - -