Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

I'm trying to map 2 inputs on a UI to a server code service requesr. I've tried mapping them to the header and the query string, but they are not being mapped.

Heres the UI, with an email and password field
Image

Heres the function
Image

And mapping
Image

But the request sent to the external server API does not have the properties in the header?

Can you see what I'm doing wrong?

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

OK, so i assume this is because I need to somehow link the inout to the scope variable. How do I do this? How do I name the input?

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

Is there a before send option, or is this from an outdated version of appery?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mapping inputs to service header

Hello Allan,

"Before send" and "Success" mappings are related to the JQM project, but you use the Ionic one.
Could you show us the Server Code, which reads these parameters?

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

HI Serhii

Thank you for your response.

The parameters are not getting to the server. I have been using browser developer tools to watch the parameters being sent, and they are empty. I have attached a screen shot trying to send these as query strings, but the strings are empty. Also, when I try and send the parameters within the header, the parameters are not present.

Image

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

I think I may be misunderstanding something.

I cant seem to get any variables to be passed in my requests. How can I get this to work?

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

I really need some help on this. I've watched videos and looked and lots of tutorials, and I've followed them closely. I cant understand what I need to do, its not clear from the documentation?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mapping inputs to service header

Do you need to send data to the header parameter or query one?

Please check data, which is sent using the service with a https://requestb.in/ service
Here is an example of the mapping:
Image

And data, which server received:

Image

Alan Smith
Posts: 0
Joined: Tue Jun 10, 2014 4:59 pm

Mapping inputs to service header

Hi

I would prefer to post the data in the header.

I think the issue I am having is getting the form input into the mapping/request data header.

How do I get/map/retreive the form input into the request data?

Do I have to name the form input somehow? Add a property to the input?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Mapping inputs to service header

Please add the scope variable "email" to the property ng-model of your input component to send it's value to the service

Return to “Issues”