0

I have a problem with API which is working on Microsoft-IIS/8.5 when I'm trying call it from Android app with Retrofit2 I'm getting error 500 when I'm calling it from Postman everything is ok.

I have compare url which is generated by Retrofit with that one which I'm providing in Postman and they are equals.

Does anyone had similar issue?

On server side there is an info in error log:

Object reference not set to an instance of an object.

  • at X.MvcApplication.Application_AcquireRequestState(Object sender, EventArgs e)
  • at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  • at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Since I'm Android.Java guy maybe someone know what that means or maybe there is a problem on my side?

If it's duplicated IMO should return same results for Android and Postman request but it's returning two different, moreover looks that there is something missing in my code but really I have no idea. All request are going now with header:

"Cache-Control: no-cache",
"Content-Type: application/json"
Community
  • 1
  • 1
Robert
  • 1,202
  • 4
  • 18
  • 35
  • Did you set all the parameters of the query? Maybe, backend needs in some additional HTTP headers? – Alexander Jun 03 '16 at 08:07
  • Yes, as I have mentioned I printed out uttpurl reqest and it contains params with correct values. – Robert Jun 03 '16 at 08:19

1 Answers1

0

I don't know about your code,there are several possibilities:

  1. postman is for web http send, it has cookies, may be your server used cookies.

  2. contentType: when you send some parameters by postman, no matter what http content type you set, the parameters is always joint after the host url,just like GET. In this case, your server may not get the right parameter

LichFaker
  • 55
  • 8
  • curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: " "" so onyl one chance is the header named Cache-Control I'll try to set there is any settings about contentType :/ – Robert Jun 03 '16 at 09:02