Skip to main content
Solved

HTTPCaller malforming URL when using query string parameters

  • September 27, 2019
  • 2 replies
  • 126 views

Forum|alt.badge.img

I'm trying to download a filtered csv from a URL but the HTTPCaller is transforming the URL in a weird way by adding codes for single quotes, greater than signs, and spaces in the URL. The previous step in my model is a SQLCreator that queries a table in my database to figure out what the latest payment_date is, then returns that date formatted as: '2019-09-20T00:00:00.000'

In the HTTPCaller, I have the following in the Request URL: https://*baseURL*.csv?$where=payment_date

...and the following as a Query String Parameter: > (in the name column) and InvoiceDate (in the value column but set as the result of the query above.

The URL I need to form with this is:

https://*baseURL*.csv?$where=payment_date>'2019-09-20T00:00:00.000'

Instead, what I'm getting is this which doesn't work in a browser or in FME:

https://*baseURL*.csv?$where=payment_date&%3E=%272019-09-20T00%3A00%3A00.000%27'

 

The best I can tell is that FME is translating the symbol for greater than into &%3E= , the symbol for a single quote as %27 , and the symbol for colon as %3A. This doesn't work with the source that I'm trying to pull from. Is there a way to force the HTTPCaller to keep the text as is without changing it?

 

 

Best answer by hollyatsafe

Hi @nick30097,

 

The Query String in HTTP Caller will add to the end of the Request URL in the format ?Name=Value or, if there are already parameters set at the end of the URL this will add & to indicate a new parameter. Since $where=payment_date>'2019-09-20T00:00:00.000' is actually a single Query String this entire thing needs to be set up as such:

The HTTPCaller will still encode the characters however once your request is correctly formatted, that is, without the extra & and =

http://test?%24where=paymentdate%3E%272019-09-20T00%3A00%3A00.000%27

and this should still be able to return the expected result.

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

Forum|alt.badge.img+2
  • Best Answer
  • September 27, 2019

Hi @nick30097,

 

The Query String in HTTP Caller will add to the end of the Request URL in the format ?Name=Value or, if there are already parameters set at the end of the URL this will add & to indicate a new parameter. Since $where=payment_date>'2019-09-20T00:00:00.000' is actually a single Query String this entire thing needs to be set up as such:

The HTTPCaller will still encode the characters however once your request is correctly formatted, that is, without the extra & and =

http://test?%24where=paymentdate%3E%272019-09-20T00%3A00%3A00.000%27

and this should still be able to return the expected result.

 


Forum|alt.badge.img
  • Author
  • September 30, 2019

Hi @nick30097,

 

The Query String in HTTP Caller will add to the end of the Request URL in the format ?Name=Value or, if there are already parameters set at the end of the URL this will add & to indicate a new parameter. Since $where=payment_date>'2019-09-20T00:00:00.000' is actually a single Query String this entire thing needs to be set up as such:

The HTTPCaller will still encode the characters however once your request is correctly formatted, that is, without the extra & and =

http://test?%24where=paymentdate%3E%272019-09-20T00%3A00%3A00.000%27

and this should still be able to return the expected result.

 

Fantastic! That solved the problem. Thanks Holly!