I have something like the following URL:
http://www.123.com/api/link/http://www.bla.com/?contenId=123&User=test
But i know it needs to be encoded to be valid. Is there a way to encode it to be on the right format, something like the following:
http://www.123.com/api/link/http%3a%2f%2fwww.bla.com%2f%3fcontenId%3d123%26User%3dtest
I made the change suggested and am still receiving a similar error:
{"error":"invalid_request","error_description":"invalid grant type"}
This error is likely to happen if the url-encoding is not set properly. The updated code is belowAny help would be greatly appreciated!
<?php$client_id = '...';$redirect_uri = 'http://website.com/foursquare2.php';$client_secret = '...';$code = $_REQUEST['code'];$ch = curl_init();curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));curl_setopt($ch, CURLOPT_URL, "https://id.shoeboxed.com/oauth/token");curl_setopt($ch, CURLOPT_POST, TRUE);curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);curl_setopt($ch, CURLOPT_POSTFIELDS, array('grant_type' => 'authorization_code','code' => $code,'client_id' => $client_id,'client_secret' => $client_secret,'redirect_uri' => $redirect_uri));$response = curl_exec($ch);$err = curl_error($ch);curl_close($ch);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}?>
I'm having a hard time figuring out why I'm not getting any return back from lambda when I try to test this function.
var https = require('https');var querystring = require('querystring'); var postData = querystring.stringify({ Name: "jaws", sex: "Male", Age: "25", Location: null, Level: "Rookie" }); console.log(JSON(postData)); var options = { headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': postData.length } }; var postreq = https.request(options, function (res) { }); postreq.on('error', function (err) { console.log(err); }); postreq.write(postData); postreq.end();
When I run this locally on the console terminal. I get this return.
"Make=JEEP&Model=Grand%20Cherokee&ModelYear=2015&Series=&Trim=Limited" { Error: connect ECONNREFUSED 127.0.0.1:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1173:14) errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 443 }
I have only been playing around with Lambda for two weeks. Trying to get an output(postDate) back JSON. I love to hear some feedback, where did I go wrong, thanks.
JavaScript function:
var s="ì";var e=encodeURIComponent(s);document.write(e);
Exspected result: %C3%ACResult: %C3%AC
PHP function:
$s = "ì";echo $e = urlencode($s);
Exspected result: %C3%ACResult: %EC
What am I doing wrong?
I'm trying to send a USSD that contains an Email but the '@' character is causing problems.
URLEncoder.encode("user@gmail.com", "UTF-8")
This is what I've tried so far but no luck.
Σπίτι - Χάρτης - Μυστικότητα - Σύνδεσμοι - Copyright © 2018 Cortex IT Ltd : Επαφή : admin @ cortexit.co.uk
Please note that by viewing our site you agree to our use of cookies (see Μυστικότητα for details). You will only see this message once.