Getting Different HTTP response across OS

I’m running a script using

url =
content =

when I print the content on Windows OS I’m getting a result (cropped)


BUT, when I run on Ubuntu, I’m getting something different (cropped)


Does depends on the OS on how it encodes data?

Looks like uses the default system encoding, which is different between Windows and *nix.

1 Like

Yes, ah Kathy beat me to it.

1 Like

Since you’re on 8.x try instead.

1 Like

great thanks a lot!,
now, how could I get the same output that I was having BUT with So fair I have:

client =
response = client.get('')
text = response.getText()

returns empty unicode

That explains a lot!
Is it possible to set the enconder with
Is “chunked” the default enconder name (I don’t even know if that exists) for Windows?

What about printing the response object itself or response.getBody()?

1 Like

also empty :thinking:


Where are you seeing a reference to “chunked”? That probably refers to HTTP chunked transfer encoding… not the encoding of some content string.

1 Like

No, but it is with, if the response doesn’t indicate a charset; you can pass a charset name (i.e. "UTF-8") to the response.getText() method.

Windows (on most locales, anyways) defaults to ISO-8859-1.

Can you post your exact script that you’re using with httpClient()?

1 Like

I saw that when I got the headers. Oh ok, thanks for the explaining.


client =
response = client.get('')
response = response.getText()

I wouldn’t expect getText() to be what you want if you’re requesting a .wav file; .getBody() is probably more useful. It’s also possible that this target service (an Ignition gateway? Something else?) is returning a redirect or some other partial response that httpClient isn’t following; you should inspect the response object (status code, etc).

1 Like

Yes the response is from Ignition Gateway
I just wish to return the response and then use system.file.writeFile(path, file). But this functions needs a byte [ ] type file

Try this instead:

client ="ALWAYS")

response.getBody() will be the byte[] you need to actually write the file. This was never going to work with you turning the binary data into a String first, regardless of encoding.


thanks a lot, I ended up using pure Jython and non Ignition build in function. BUT I will definitely try that.

Great, this is returning the same response across OS!
Good for us that the server is 8.1.x.
What was happening? Who was blocking the download, the client instance? or the Ignition Server was not allowing access to the file while in NORMAL Redirect Policy?

I did inspect it. I got ‘OK’ for the status and 200 for the code. So, I assumed the problem was related to the encoding. Apparently not.

I think our docs are wrong and the default redirect policy is actually NEVER.

I’m surprised you were getting a 200 status code. I would have expected a 302 redirect since you are including “main” in the URL, which is no longer necessary but continues to work via redirect.