Page 1 of 1

Posting object to external web api

Posted: Mon Apr 21, 2014 4:47 pm
by Abu Ali

hi,
i have the same issue as
https://getsatisfaction.com/apperyio/...

i want to POST to Web API, but on the server iam receiving nulls only!
the case in the link is very similar to mine but there is no clear solution

thanks


Posting object to external web api

Posted: Mon Apr 21, 2014 6:44 pm
by Alena Prykhodko

Hello,

Please show us screen shots of Settings, Request tabs.


Posting object to external web api

Posted: Mon Apr 21, 2014 7:48 pm
by Abu Ali

this is my webAPI function

Code: Select all

     public string PostRegister([FromBody]HUser value) 
     { 
             string s = ""; 
         try 
         { 
             s += value.DeviceID + ";"; 
             s += value.Email + ";"; 
             s += value.HUserID + ";"; 
             s += value.Name + ";"; 
             s += value.Password + ";"; 
             s += value.Phone + ";"; 
             s += value.HAddresses[0].Address + ";"; 
             return s; 
         } 
         catch(Exception ex) 
         { 
            return s+" | Error:"+ex.Message; 
         } 
 } 

HUser and HAddress are classes

the json format for HUser is

{"HUserID":1,
"Name":null,
"Phone":null,
"Password":null,
"DeviceID":"1",
"IsBanned":false,
"IsActivated":null,
"Email":null,
"ActivationCode":null,
"HAddresses":[]}

and these are settings and requests tabs

Image Image

i tried with/without proxy
i tried defining object fields as request parameters too but no luck

thanks


Posting object to external web api

Posted: Tue Apr 22, 2014 3:04 am
by Illya Stepanov

Hi Ali,

Sorry, the code from external services is outside the scope of our support.

But we can help you to figure out where the problem is (server or client side).

At first you should activate Appery.io proxy (if you send your request to the external server).

After it please follow these steps:
ol
liRun your app in desktop chrome browser./li

liF12 to open browser debugger. http://prntscr.com/3bymgp/direct/li

liClick on the Network tab. http://prntscr.com/3bymqk/direct/li

liThen run your application and activate your service./li

liYou will see in your network debugger a request to the Appery.io proxy./li

liOpen it and discover. There is all information about communication with server. (request headers, parameters, response headers, response body etc..)/li
/ol
http://prntscr.com/3bynxh/direct

http://prntscr.com/3byojw/direct

When you do this please make screenshots where we can see your request parameters and response body.

Regards.


Posting object to external web api

Posted: Tue Apr 22, 2014 3:26 am
by Abu Ali

this what will happen if i click "test"
Image

thanks


Posting object to external web api

Posted: Tue Apr 22, 2014 3:50 am
by Abu Ali

finally it works and these are final screenshots:

settings:

Image

Request:

Image

deb:

Image


Posting object to external web api

Posted: Tue Apr 22, 2014 4:05 am
by Illya Stepanov

So now it works as expected?


Posting object to external web api

Posted: Tue Apr 22, 2014 5:08 am
by Abu Ali

yes


Posting object to external web api

Posted: Tue Apr 22, 2014 5:12 am
by Illya Stepanov

Glad it's working! Thanks for the update!