Solved

@ symbol in httpcaller POST multipart upload value

  • 31 January 2019
  • 9 replies
  • 8 views

When I have a @ symbol in a POST mutipart upload value

 

FME displays the below error when I run the work bench.

 

This FME edition does not recognize the `' function. Please ensure that the current platform supports this function, the function name is spelled correctly, and that you have installed all required plug-ins

 

I have used a string replacer tranformer and encoded with %40 as a workaround in the past, but with the form email validation on CKAN it does not accept the %40 encoding and expects an @ symbol. Does anyone have any idea how to upload values with an @ symbol in the httpcaller?

icon

Best answer by 020 1 February 2019, 03:42

View original

9 replies

Userlevel 4

What happens if you create a new attribute, e.g. "author_email" with the value "a@a.com" and reference this attribute in the HTTPCaller?

What happens if you create a new attribute, e.g. "author_email" with the value "a@a.com" and reference this attribute in the HTTPCaller?

Hi David unfortunately the same error remains when I create a new attribute and reference this attribute in the HTTPCaller as you suggested.

Figured it out, I just used 'Specify Upload Body' option in the 'Upload Data' field in the HTTPCaller and wrote my own JSON in the upload body with the Content Type as JSON.

{

 

"id": "@Value(name)",

 

"author_email": "@Value(contactPoint.hasEmail)",

 

"maintainer_email": "@Value(contactPoint.hasEmail)"

 

}

Badge +4

I've just come across this issue too. we're upgrading from FME 2015, and it wasn't an issue in that version of the httpcaller (v0). Is there no way to escape that @symbol?! don't really relish having to build my own multipartform just for this - although I know this is probably the workaround.

Userlevel 4

I've just come across this issue too. we're upgrading from FME 2015, and it wasn't an issue in that version of the httpcaller (v0). Is there no way to escape that @symbol?! don't really relish having to build my own multipartform just for this - although I know this is probably the workaround.

You can try escaping special characters using the TextEncoder set to URL Encoding.

Badge +1

The issue is still current in FME2020.2. The solution offered by @david_r​ does not work, since it will reject the json values. Also %40 as an escape does not work, it will push %40 and it won't display the @-character.

 

I think the real problem is, that FME expects the @ character at that point to be a function, while it is not. Since there is not mention of any function, it does not understand which function should be called and crashes.

 

edit: I was able to solve it, using a PythonCaller, but I don't think that should be the way to go.

Userlevel 4

The issue is still current in FME2020.2. The solution offered by @david_r​ does not work, since it will reject the json values. Also %40 as an escape does not work, it will push %40 and it won't display the @-character.

 

I think the real problem is, that FME expects the @ character at that point to be a function, while it is not. Since there is not mention of any function, it does not understand which function should be called and crashes.

 

edit: I was able to solve it, using a PythonCaller, but I don't think that should be the way to go.

If you think it's a but, you should consider sending it to Safe support together with a minimal workspace that demonstrates the issue. Perhaps also link back to this thread.

Badge +14

The issue is still current in FME2020.2. The solution offered by @david_r​ does not work, since it will reject the json values. Also %40 as an escape does not work, it will push %40 and it won't display the @-character.

 

I think the real problem is, that FME expects the @ character at that point to be a function, while it is not. Since there is not mention of any function, it does not understand which function should be called and crashes.

 

edit: I was able to solve it, using a PythonCaller, but I don't think that should be the way to go.

Just submitted a case to support for a project that I'm working on that apparently requires this... I can't believe I haven't ran into it before.

Badge

Using a StringReplacer with @Value(_at)Value(_at) as Replacement Text for @ did the trick for me.at

Reply