# httpClient() to GoogleSheets

**URL:** <https://forum.inductiveautomation.com/t/httpclient-to-googlesheets/117533>\
**Category:** Ignition\
**Tags:** ignition83, scripting, perspective\
**Created:** [October 19, 2026, 9:03pm UTC](https://forum.inductiveautomation.com/t/httpclient-to-googlesheets/117533 "2026-10-19T21:03:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [October 19, 2026, 9:03pm UTC](https://forum.inductiveautomation.com/t/httpclient-to-googlesheets/117533/1 "2026-10-19T21:03:20Z")

</div>

I've been tasked to try to connect some spreadsheets to Ignition to read data and update some information in our dashboards.

I started to look into the Google Sheets API and the Oauth2 I can't get past the authentication, it no matter what I have tried it always says access is blocked.

Then I tried with `httpClient()` and `client.post()` with the `clientID` and `clientSecret` I had generated in the Google auth Platform but I get the same response when I print `client.text`.

```python
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<!-- GSE Default Error -->
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://accounts.google.com/signin/oauth/error?authError= ... >here</A></BODY>
</HTML>

```

If I can get some direction it would be appreciated.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 19, 2026, 11:07pm UTC](https://forum.inductiveautomation.com/t/httpclient-to-googlesheets/117533/2 "2026-10-19T23:07:40Z")

</div>

If the webserver is responding with an HTML body you likely need to pass explicit content type and/or accept headers in your requests.

A "moved permanently" might also be because `httpClient` by default doesn't follow redirects; you can change that when constructing your httpClient instance:

> **[Parameters​ - system.net.httpClient | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-net/system-net-httpClient#parameters)**
>
> This function is used in Python Scripting. | Provides a general use object that can be used to send and receive HTTP requests.

---

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [October 19, 2026, 11:30pm UTC](https://forum.inductiveautomation.com/t/httpclient-to-googlesheets/117533/3 "2026-10-19T23:30:12Z")

</div>

I was declaring the headers according to another post I saw. But solution was the redirection, just had to change the parameter to `redirectPolicy = "NORMAL"` and I got response with the data. I also tried to do `kwargs` but it wouldn't work so I had to declare the other parameters to their default value.

For posterity here was the code I was testing:

```python
headerValues = {
    'client_id':'clientid.apps.googleusercontent.com',
    'client_secret': client_secret,
    'grant_type' : 'client_credentials',
    }
authServerURL = 'https://accounts.google.com/o/oauth2/auth'
redirectPolicy = "NORMAL"
timeout = 10000
bypassCertValidation = False
username = None
password = None
proxy = None
cookiePolicy = "ACCEPT_ORIGINAL_SERVER"

#Send POST
client = system.net.httpClient(timeout, bypassCertValidation, username, password, proxy, cookiePolicy, redirectPolicy)
response = client.post(authServerURL, "https://docs.google.com/spreadsheets/d/fileURL", headerValues)
print response.statusCode
print response.text

```
