You need to sign in to do that
Don't have an account?
Masahito Akashi
POST parameters lost, using Continuation Class
I requested callout POST by setting the parameters in the setBody using Continuation Class.
but Parameter is not set in received server.
but Parameter is not set in received server.
// Create continuation with a timeout Continuation con = new Continuation(40); // Set callback method con.continuationMethod='processResponse'; // HTTP Request HttpRequest req = new HttpRequest(); req.setEndpoint(getCalloutURL()); req.setMethod('POST'); // POST Parameters List<String> params = new List<String>(); params.add('UserId=' + 'test'); params.add('Password=' + 'pass'); req.setBody(String.join(params, '&')); // Add callout request to continuation this.requestLabel = con.addHttpRequest(req); return con;How should I do it?
Also, as a thought, are you trying to do BASIC auth with your params here? In which case something more like
Would be what I'd use... (obviously you can tokenize in your data from strings at "test:pass" )
If I was a simple request, I was able to successfully send a POST parameter.
But it did not receive a POST parameter when transmitting the same content using the Continuation.
The following code works correctly. (But it fails when using the Continuation...)
This parameter is the example. There are other a lot of options.
This authentication method I think that's nonsense. But is a specification of a third-party Web services.
Thanks.
Thanks.