Skip to main content

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?

 

 

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.

 


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!


Reply