Setup POST request node

Hello KNime community,

i’m facing a problem setting up an API call. I’m used to the GET requests and also the referring node however I can’t get the POSt request node to work.

I do have to following parameters from the provider of the API

curl -X POST
https://{HOMEPAGE}
-H 'Authorization: Basic {TOKEN}
-F username={username}
-F password={YourPassword}
-F grant_type=password
-F scope=customer-api

my question is now, how do I set up the POST request node or how can I transfer the information to the node.

many thanks in advance

AZ

As far as I know -F in curl means that a multipart/form-data request is sent. This means that the request body must follow a certain scheme. Unfortunately we don’t have a node yet that allows you to create the request body in the correct format, but it may be possible using e.g. the Java Snippet node. The request body in your example will look similar to

Content-Type: multipart/form-data; boundary=AaB03x

--AaB03x
Content-Disposition: form-data; name="username"

{username}
--AaB03x
Content-Disposition: form-data; name="password"

{YourPassword}
--AaB03x
Content-Disposition: form-data; name="grant_type"

password
--AaB03x--
Content-Disposition: form-data; name="scope"

customer-api
--AaB03x--

Thanks for the reply thor
however I’m not that familiar with java and unfortunately the body is not editable in the POST node.
is there no other way to transfer the info to the node
cheers

AZ

As I said currently there is no other way than creating the body “by hand”.