Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Posting object to external web api

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Posting object to external web api

Hello,

Please show us screen shots of Settings, Request tabs.

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Posting object to external web api

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Posting object to external web api

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.

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Posting object to external web api

this what will happen if i click "test"
Image

thanks

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Posting object to external web api

finally it works and these are final screenshots:

settings:

Image

Request:

Image

deb:

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Posting object to external web api

So now it works as expected?

Abu Ali
Posts: 0
Joined: Mon Apr 07, 2014 8:50 am

Posting object to external web api

yes

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Posting object to external web api

Glad it's working! Thanks for the update!

Return to “Issues”