Page 1 of 2
Mapping inputs to service header
Posted: Tue Feb 20, 2018 4:24 pm
by Alan Smith
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
Heres the function
And mapping
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?
Mapping inputs to service header
Posted: Tue Feb 20, 2018 8:36 pm
by Alan Smith
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?
Mapping inputs to service header
Posted: Tue Feb 20, 2018 8:59 pm
by Alan Smith
Is there a before send option, or is this from an outdated version of appery?
Mapping inputs to service header
Posted: Wed Feb 21, 2018 7:39 am
by Serhii Kulibaba
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?
Mapping inputs to service header
Posted: Wed Feb 21, 2018 9:36 am
by Alan Smith
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.
Mapping inputs to service header
Posted: Wed Feb 21, 2018 11:26 am
by Alan Smith
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?
Mapping inputs to service header
Posted: Wed Feb 21, 2018 11:37 am
by Alan Smith
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?
Mapping inputs to service header
Posted: Thu Feb 22, 2018 10:01 am
by Serhii Kulibaba
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:
And data, which server received:
Mapping inputs to service header
Posted: Thu Feb 22, 2018 12:26 pm
by Alan Smith
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?
Mapping inputs to service header
Posted: Thu Feb 22, 2018 1:56 pm
by Serhii Kulibaba
Please add the scope variable "email" to the property ng-model of your input component to send it's value to the service