Why rest assured doesn't let post woth link whose have curly braches?

553 views
Skip to first unread message

Asta Leonavičienė

unread,
Feb 10, 2017, 9:58:56 AM2/10/17
to REST assured
Hi, i got the error, when i try to use curely braches:

java.lang.IllegalArgumentException: Invalid number of path parameters. Expected 1, was 0. Undefined path parameters are: "aaa":"L03T01US01sdf8XPG001","a":"555".

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:77)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
    at io.restassured.internal.RequestSpecificationImpl.assertCorrectNumberOfPathParams(RequestSpecificationImpl.groovy:1336)
...

Johan Haleby

unread,
Feb 10, 2017, 10:00:21 AM2/10/17
to rest-a...@googlegroups.com
Curly are used for defining parameters, you would have to disable url encoding if you want to supply curly braces.

--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Asta Leonavičienė

unread,
Feb 13, 2017, 4:01:42 AM2/13/17
to REST assured
Ho i should do this?
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.

Johan Haleby

unread,
Feb 13, 2017, 4:10:34 AM2/13/17
to rest-a...@googlegroups.com
Have you read the docs I linked to? given().urlEncodingEnabled(false).. and then you can supply your query string exactly as you want (but you have to URL encode it yourself if you need to).

/Johan

To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages