1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Read API response via microcontroller

Discussion in 'Google API' started by Ebolisa, May 14, 2018.

  1. #1
    Hi,

    I’m having a microprocessor sending data to a worksheet and the code is working fine. The data sent is logged in each cell correctly.

    If I launch via browser the link “ https://script.google.com/macros/s/<my_code>/exec?temperature=10&humidity=20 ”, my spreadsheet’s script code answers with the word “Ok”. Inspecting the results, I see the following, which is all correct:

    <html>
    <head>
    <link rel="alternate stylesheet" type="text/css" href="resource://content-accessible/plaintext.css" title="Wrap Long Lines">
    <style></style>
    </head>
    <body>
    <pre>Ok</pre>
    </body>
    </html>

    SEMrush
    However, if I read the web response via the microcontroller (String line = client.readStringUntil('\r')), I get different results:

    <HTML>
    <HEAD>
    <TITLE>Moved Temporarily</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <H1>Moved Temporarily</H1>
    The document has moved <A HREF="https://script.googleusercontent.com/macros/echo?user_content_key=bla bla bla">here</A>.
    </BODY>
    </HTML>


    Can someone please tell me why I cannot read the response remotely? I’m new to this and I’m a bit lost.

    TIA
     
    Ebolisa, May 14, 2018 IP
    SEMrush