1

I am trying to update values to Firebase. According to Firebase:

curl -X PUT -d '{ "first": "Jack", "last": "Sparrow" }' \
 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json'

We can update using put command. Using curl works fine, but when I look at the header of ESP8266HTTPClient, I don't see any put or patch method there.

I can only see the following:

int GET();
int POST(uint8_t * payload, size_t size);
int POST(String payload);

Whereas in NodeMCU documentation, it is clearly stated it supports the put method too.

http.put(url, headers, body, callback)

http.put() documentation

I cannot find any example.

How can I implement the put method in NodeMCU?

gre_gor
1,6824 gold badges18 silver badges28 bronze badges
asked Oct 19, 2017 at 4:18
2
  • 1
    Just because NodeMCU's Lua HTTP library has a PUT method, doesn't mean Arduino's C++ HTTP library has it too. Commented Oct 19, 2017 at 13:35
  • Also you are only using the NodeMCU board not the firmware, so "implementing the put method in nodemcu" makes no sense. Commented Oct 19, 2017 at 13:39

1 Answer 1

1

pardon me if i asked too soon. I found the answer. all verb are supported. but post and get got their own names.

 int httpCode = http.sendRequest("PUT", String(data));

enven post method implement the sendRequest.

answered Oct 19, 2017 at 4:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.