Solved

http connector content using CR problem

  • 6 January 2022
  • 1 reply
  • 36 views

Userlevel 3
Badge +7

I am trying to connect to an outside API using the HTTP-connector. I need to call different procedures, using different content-types (application/json, multipart/form-date). I want to build the process variable ‘content’ within a template and feed it to the http-connector. This fails.

When I select the content from a table-field with datatype nvarchar(4000) and multiline control it works fine. I can select the content from the column and feed it to the http connector. It also works when  I use a taskparameter to paste the content into the process variable.

So far I figured out that it has something to do with the CR / linefeed. But when I simply remove all CR's, this still won't work. Since I need to compose the content from some static text and a few variables (pdf-data for example) I do need the template.

Example of what I am trying to build (which works fine when using the task-parameter):

 

Content-type:

multipart/form-data;boundary=abcde12345

Content:

--abcde12345
Content-Disposition: form-data; name="payload"

{
  "name": "test.pdf",
  "extract": true,
  "extractionTypes": [
    "TEXT_TAGS"
  ]
}


--abcde12345
Content-Disposition: form-data; name="file"
Content-Type: application/pdf

(pdf-data)

--abcde12345--

 

Does anybody know how to build this content within a template?

icon

Best answer by Hugo Nienhuis 7 January 2022, 14:30

View original

1 reply

Userlevel 3
Badge +7

Prefix Unicode character string constants with the letter N. Without the N prefix, the string is converted to the default code page of the database.

Works, problem solverd.

Reply