-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update Content-Type header to application/x-www-form-urlencoded #5244
fix: Update Content-Type header to application/x-www-form-urlencoded #5244
Conversation
❌ Deploy Preview for dev-web-novu failed.
|
aa415c7
to
1014a11
Compare
}, | ||
body: JSON.stringify(params), | ||
body: new URLSearchParams(params), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we send the data in the URL according to their documentation? and I'm not sure about the POST method.
Btw the URL should start with https
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var request = require("request");
var options = { method: 'POST',
url: 'https://enterprise.smsgupshup.com/GatewayAPI/rest',
form:
{ method: 'sendMessage',
send_to: '919820XXXXXX',
msg: 'This is sample test message from GupShup',
msg_type: 'TEXT',
userid: 'XXXXXX',auth_scheme: 'PLAIN',
password: 'XXXXX',
format: 'JSON' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
url = "https://enterprise.smsgupshup.com/GatewayAPI/rest"
payload =
"method=sendMessage&send_to=919820XXXXXX&msg=This%20is%20sample%20test%20message%20from%20
GupShup&msg_type=TEXT&userid=XXXXXX&auth_scheme=PLAIN&password=XXXXX&format=JSON"
response = requests.request("POST", url, data=payload)
print(response.text)
@LetItRock They support both GET
and POST
method. I took the example from their Node
and Python
codes.
Should we update it to use GET
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BiswaViraj I was assuming they support both :) all right let's leave it then :)
What change does this PR introduce?
Why was this change needed?
Other information (Screenshots)