Page 2 of 2

service error unexpected token

Posted: Wed Jul 10, 2013 10:20 pm
by steve5588065

Katya

Further to this
I have found the issue is caused by a space in the product request parameter
parameter value is 'Gift Voucher'

It works fine from the Service test page and if I look in Chrome tools Network tab I see service url has Gift Voucher encoded
i.e /Gift%20Voucher/

When sending via service from the app page, chrome tools shows
/Gift Voucher/

Why does it do that?

regards
Steve


service error unexpected token

Posted: Wed Jul 10, 2013 11:11 pm
by Igor

Hello,

[quote:]
It works fine from the Service test page and if I look in Chrome tools Network tab I see service url has Gift Voucher encoded
i.e /Gift%20Voucher
[/quote]

Since spaces are not allowed in a URL, the %20 represents a space.
Please check the service documentation, What format does the service support json,xml,SOAP?


service error unexpected token

Posted: Wed Jul 10, 2013 11:35 pm
by steve5588065

Hi Igor

I understand that

My question is
Why does the url get encoded when I test from the Service test page but does NOT get encoded when I execute the service from within the app


service error unexpected token

Posted: Thu Jul 11, 2013 3:41 pm
by Maryna Brodina

Hello! In request parameters mapping where might be spaces or any other extra symbols in URL (for example in product parameter) add the following JS:
codereturn encodeURIComponent(value);/code