steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

service error unexpected token

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?

steve5588065
Posts: 0
Joined: Tue Feb 26, 2013 6:36 am

service error unexpected token

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

service error unexpected token

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

Return to “Issues”