Now, to make sure that you understand that a suitable request data that we just created, what we did
is basically the following.
We created variables and we have sent values or the values of these variables to the ACTU request.
Now, you can't comment this line, the news, this ACTU request that a variable and as you can see,
without the variables, you can actually pass the data directly.
So the key here is this.
This is our API key.
And the concern is that Atchinson that you already mentioned, its location is at home office and it
devalues one, two and three out of these random values.
This can be used for testing purposes.
You can come this and use this line.
They both work the same.
But if you have problems or if you are suspecting something, you can use this one for testing.
Anyway, I will leave it to you if you wish.
Now, to send the HTP post request, we need to create an integer and call it a P response called equal
htp dot post.
Now the post will take.
This variable, the one that we created the data and it will send it through the HDTV, if you need
an estimate request with a content type text or plain, you can change the header.
But this is something I want to recommend because what we are doing here is more advanced.
We are sending variables now.
I will add other ways to add, let's say, text or plain text or adjacent file to the city request.
But what we are doing here is simply sending sensor readings and variables so you can stick to the content
header that we created, which is basically application and this is its type w w w we are all encoded
and this is the encoding part.
Now.
To make sure that our request did go and we don't have any error, we initialize an integer so that
the result of this request can be stored and this variable.
Now, to check this variable, we need to ask using an if statement and ls now.
Let's do this now, they've said and will be if the Stoebe response code is above zero, this means
that we have seen data and we received a value above zero as a response to the post request.
And that case we need to print on the Syrian monitor.
Brent HTP response code.
And we need to print the code to know if there is an issue so I don't print.
And the response, quote, now, otherwise, we need to cover this, too, if the value isn't above
zero, it means that there is an error.
So in that case, we will use the Ayles and we will see error code.
Code and words print the same code at the end.
We need to end our request.
So we need to add Test-tube and.
This will end the city request process and we need to close this.
Now.
Else, as you can see, this is our F statement that we did close.
Now, if the Wi-Fi is connected, it will do all of this, otherwise it will prevent that wi fi is not
connected.
So we can write serial, dot, print, new line and we can simply write wi fi disconnected.
After that, we need to make sure that we are not receiving that continuously, so.
Let's roll this one.
OK, we need to either delay.
Thirty thousand milliseconds, which is basically 30 seconds.
So this will tell our ISP to send an active post request every 30 seconds to send since all that.
Now, as I already mentioned, I will post the code, but you have to edit the following lines.
The first thing that you need to edit is their society and password.
And the second thing that you need to read is the Savani, which is this one, and you also need to
read it, the AP Ikki.
We did initialize the civil communication for debugging purposes.
It's not something you have to do, but it's a good practice so that you can know if your code has errors.
Now, after doing all of this.
You can verify your code.
We will check it if that is errors.
I will solve them now to make sure that we can upload this code.
OK, now that statements and capital letters.
I did this.
OK, now I think that we might have some spelling errors because I was writing as I was speaking and
explaining so this might happen.
OK, Duncan Barling, great.
We do not have any rules now what you need to do is simply copy this code and based it on your ISP and
we are going to do this.
And the next lesson to test out our coding and to make sure that the server receives the data and everything
is working fine.
That's it for this lesson.
If you have any questions, please ask in the Q&A board.
Thanks for watching.
This is Asharaf from educational engineering team.