#1 2015-11-06 16:58:14

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

DateTime format in URI?

Hello,

the call in a browser returns nothing

  http://localhost:888/root/CustomDateTimeService.GetValues?SpecificDateTime=2015-05-01T23:59:23

On the server side I am getting the value of TDateTime  is zero.

Is this a bug, or how should I pass the DateTime?

Thank you!


Greets CC

Offline

#2 2015-11-06 17:02:36

mrgcms
Member
Registered: 2012-04-11
Posts: 5

Re: DateTime format in URI?

Should CustomDateTimeService.GetValues not be CustomDateTimeService/GetValues?

Offline

#3 2015-11-06 17:06:20

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: DateTime format in URI?

mrgcms wrote:

Should CustomDateTimeService.GetValues not be CustomDateTimeService/GetValues?

No, because it is an interface based service

Last edited by cypriotcalm (2015-11-06 17:06:43)

Offline

#4 2015-11-06 17:11:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: DateTime format in URI?

Sounds like an URI encoding problem.

Try to POST the date value as a JSON object in a HTTP body.

Offline

#5 2015-11-06 17:20:26

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: DateTime format in URI?

ab wrote:

Sounds like an URI encoding problem.

Try to POST the date value as a JSON object in a HTTP body.

Done!

Request:

http://localhost:888/root/CustomDateTimeService.GetValues

BODY:
{
  "SpecificDateTime":"2015-05-01T23:59:23"
}

Response:

{
  "errorCode": 406,
  "errorText": "Shared execution failed (probably due to bad input parameters) for ICustomDateTimeService.GetValues"
}

Last edited by cypriotcalm (2015-11-06 17:21:29)

Offline

#6 2015-11-06 19:03:51

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: DateTime format in URI?

Try to replace the "T" with " ".

Offline

#7 2015-11-06 19:07:55

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: DateTime format in URI?

danielkuettner wrote:

Try to replace the "T" with " ".

It doesn't work :-(

Offline

#8 2015-11-06 19:27:00

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: DateTime format in URI?

In your URI are the ' missing.

Offline

#9 2015-11-09 08:16:54

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

Re: DateTime format in URI?

@Daniel
I've tried with the ''s :-) nothing happened :-(

@ab
is there some news about the error? is it a bug or a feature? ;-) Thanks for your help anyway! :-)

Offline

#10 2015-11-09 08:48:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: DateTime format in URI?

I'm not able to reproduce your problem here.

Offline

Board footer

Powered by FluxBB