So basically, I have created a recipe in IFTTT which make use of the MAKER.
So IF maker, THEN send SMS.
But apparently the GET request can't seem to get through.
This is my GET statement, am I missing out anything?
Button is my event name. KEY is my key from the maker.
String url = "/trigger/Button/with/key/?key="KEY"";
esp8266.println("GET "+ url +" HTTP/1.1");
Apparently I'm getting bad request and sometimes wrong syntax.
Please help.
You may be missing a Host header:
GET /url HTTP/1.1
Host: www.targetsite.com
Related
I am working with Twilio Flow to create a WhatsApp Chat bot.
This bot allows user to start chat and respond with specific terms or numbers to proceed. It works fine, now I have added "Make HTTP Request" WIDGET to call an URL for posting the data received in response to DB.
When the HTTP Request is made, it returns FAIL & SUCCESS for some reasons,
On checking logs, i found out that a URL when any parameter is without any space or any special character, HTTP request gets success with Response code 200, but when its more than a word with added space or any special character HTTP request is failed and returned with Response code 500.
HTTP Request URL :
https://websiteurl.com/page.php?whatsapp_number={{contact.channel.address}}&message={{widgets.ReplyReceived5.inbound.Body}}
I also tried to make HTTP Request to https://webhook.site, but it also failed.
Added SUCCESS and FAILED Request Screenshot below.
Any help to fix this?
Image of HTTP Request getting SUCCESS with response code 200, Message parameter in URL without any space or special character
Image of HTTP Request FAILED with response code 500, Message parameter in URL with space
Twilio developer evangelist here.
In Studio, you can use HTTP Params and GET which will do the encoding (to handle spaces) for you. Or, you could use Liquid Filtering like {{ widgets.boop.di.doop | url_encode }}. My amazing coworker and Studio wizard Craig Dennis recommends using HTTP params.
Let me know if this helps at all!
I'm trying to log in into a site which requires grcp content-type using requests. I alrady have a HTTP 2 client, but I don't know how body of my post request should look like.
When I'm trying to simply copy request as a curl from chrome network tab, request body looks like this:
%äEMAIL"PASSWORD(0
When I'm trying to request site with same body as I copied from chrome tab, I'mm getting response with this headers:
Grpc-Message: grpc: received message larger than max (218767392 vs. 4194304)
Grpc-Status: 8
I'm sure It's becouse wrong payload format
If anybody knows how can I pass data in request plase help.
If you're trying to send a one-off gRPC request, https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md would be helpful to know as to how to construct a message. Otherwise, using gRPC clients (https://github.com/grpc/grpc) would make more sense.
I am learning node and express and I noticed some tutorials like to send a response that looks like this:
{status: “Success”, message: “custom message”, response: {actual response object}}
My question is, what is the point of adding the extra status and message fields? Why not just return the response object by itself?
The simple reason is convenience. It sends a clear message to the client about the status of the request and what message to display based on that status. Its just a good programming practice that helps to structure your code base on how to handle errors from requests in the client side.
I have an API end-point which takes a query string as url-encoded form data and returns a json.
I have used "Content-Type":"application/x-www-form-urlencoded" as headers.
When I try sending "query=xxx" as body of http post call using composer I get an error in emulator saying "The parent is missing.".
When I try sending {"query":"xxx"} as body, I get an error in emulator saying :
Misused header name. Make sure request headers are used with HttpRequestMessage, response headers with HttpResponseMessage, and content headers with HttpContent objects.
In which format should I send the data?
You should send it like this:
URL:http://localhost:7071/api/GetStudentGrade
Body(string):studentID=${user.studentID}&coursecode=${user.coursecode}
Content type:application/x-www-form-urlencoded
Detailed image:
I think you have to change the body to an object, Also content type to application/json. Let me know if this resolves your issue.
i' m a bit new to Node, so question may be stupid...
I am sending a POST request to a website (through http.request) and I want to be able to use the invisible POST data I get along the response.
I hope this is achievable, and I think so since I am able to preview those data in Chrome debugger.
PS : I understand that we can use BodyParser to parse and get those while listening for a POST call server side, but I have found no example of how to use it coupled with an http.request.
Thanks !
If the body of the HTTP response contains JSON, then you need to parse it first in order to turn it from a string into a JavaScript object, like this:
var obj = JSON.parse(body);
console.log(obj.response.auth_token);
More info on various ways of sending a POST request to a server can be found here: How to make an HTTP POST request in node.js?
Edit : So we figured it out in the comments. The value I needed was in the form to begin with, as a hidden field. My error was to think it was generated afterward. So I'll just grab it first then login, so I can use it again for future POST requests on the website.