andypieman

Spaces in cURL values

Discussion created by andypieman on Oct 19, 2017
Latest reply on May 14, 2018 by skywillmott

The problem: I had a simple FM database that would happily read and update (I've not got to create yet) fields from WooCommerce, except if the update data has a space in it.

 

A bit more detail: I've been playing with connecting to WooCommerce using Insert from URL and the cURL options. I've read about all the pitfalls of using 'hand coded' data arrays against using the JSONSetElement, and using the likes of @$data within quotes, yet  was still getting problems with spaces in values I was trying to pass such as a product name. I've researched quite a few blog posts about these things, set up check fields to JSONFormatElements to check  the formatting is valid. What I didn't think about is the encoding, and  it wasn't mentioned in any of the previous blogs/posts.

 

The Answer: Watch out for the (tiny) "Automatically encode URL" tickbox on the "Insert from URL" dialogue that is set by default. I imagine this is stripping spaces and adding special characters.

 

Posted to hopefully avoid others having the lost hours I've had today.

 

Screen Shot 2017-10-19 at 17.41.00.png

Outcomes