Skip to main content
Solved

@ symbol in httpcaller POST multipart upload value


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?

Best answer by 020

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)"

 

}

View original
Did this help you find an answer to your question?

9 replies

david_r
Celebrity
  • January 31, 2019

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?


  • Author
  • January 31, 2019
david_r wrote:

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.


  • Author
  • Best Answer
  • February 1, 2019

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)"

 

}


nrich
Contributor
Forum|alt.badge.img+5
  • Contributor
  • October 9, 2019

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.


david_r
Celebrity
  • October 10, 2019
nrich wrote:

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.


larsatomkeere
Contributor
Forum|alt.badge.img+8

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.


david_r
Celebrity
  • January 4, 2021
larsatomkeere wrote:

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.


runneals
Contributor
Forum|alt.badge.img+20
  • Contributor
  • January 22, 2021
larsatomkeere wrote:

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.


david.van.dalen
Contributor
Forum|alt.badge.img+7

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings