Data type conversion in Web Request action

Hello,

I have the following question. In the Web Request action, does Appfarm perform any data type conversion on body content values? (Content Type: JSON, application/json)

We have cases, where we make request to an external API with the data with SSN value as a string (see the Body Content function return value on the screenshot), but we receive an error which might happen when SSN is sent as a number (more specifically, it relates to the cases when the value has β€œ0” at the beginning and it gets stripped out).

According to the logs we receive in Appfarm when request fails, the data we send includes the SSN in a string format. However, the logs provided by the external API developers indicate that the SSN is not handled properly (the β€œ0” is missing).

So, I’m wondering if Appfarm might be performing some data type conversion when handling the Web Request action? Could it be that although we use a string data type in the Web Request, it is forwarded further as an integer?

Hello Oksana Kurylo,

I recreated your SSN setup with a webrequest to webhook.site

I have two values:

  • stringValue: β€œ01234678912”
  • integerValue: 01234678912

The JSON body is like this.
bilde

When sent to webhook.site, the body is logged as:
bilde

So no, there doesn’t seem to be any implicit type casting of String to Number in the request body.

Perhaps the server your request is sent to does some type casting?

// Erik

I see. Thank you for your answer, Erik.
Yes, type casting on their side might be the reason.

1 Like