I am writing application (.NET 4.0) that should do post-request to SalesForce to submit data (to https-url, means secured connection should be used).
I've created small test that do request with some parameters (probably not all that are actually required are included). My request seems like successful, but I not sure.
What I receive from server is response that has 4 keys in header:
- Is-Processed: true;
- Content-Length: 0;
- Date: ... {"current date/time"};
- Sever: "SFDC".
Question 1:
Can I be sure that my request was correctly processed by sales force? Seems like request is more or less good, but looking into actual SalesForce data I don't see result of my request.
Question 2:
Is there any way to get more feedback from SalesForce about request sent?
Thanks a lot! Any thoughts are welcome!
P.S. Here is a code that I use to submit request:
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(strSubmitUrl);
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = aBytesRequest.Length;
myRequest.AllowAutoRedirect = false;
string strResult;
try
{
Stream newStream = myRequest.GetRequestStream();
newStream.Write(aBytesRequest, 0, aBytesRequest.Length);
newStream.Close();
WebResponse response = myRequest.GetResponse();
Stream stream = response.GetResponseStream();
int iResponseLength = 0;
if ( response.Headers["DataLength"]!=null)
{
开发者_JAVA百科 int.TryParse(response.Headers["DataLength"], out iResponseLength);
}
...
It seems like everything is fine in my code. Probably some configuration was required on SalesForce side to display submitted data.
Also, SalesForce doesn't return any data, only header, with status code 200 and data length 0.
精彩评论