Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Web Services
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Web Services
Rest Assured in a POST service
pasquale vitale
Greenhorn
Posts: 14
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi everyone,
I'm new in Rest Assured.
I have my Rest service like this:
@Path("/") public RestContextResource { @POST @Path("hello") public String hello(String name){ return "<result>Hello World : " +name+ "</result>"; } }
Now, I want to use RestAssured to call my "hello" service but I don't know how can I do it.
In the first example, I had a GET method and I've used:
response = RestAssured.given().log().all().headers(headers) .expect().statusCode(200).when().get("");
Please note that my hello method takes a name parameter.
Could you help me?
Regards
pasquy73
Vijitha Kumara
Bartender
Posts: 4109
72
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I haven't tried this myself, but did you try the example listed in
here
? There are some related to post request.
SCJP 5 | SCWCD 5
[
How to ask questions
] [
Twitter
]
pasquale vitale
Greenhorn
Posts: 14
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thank you,
Vijitha
I've resolved my issue; I've used
.with().body("body")
and I need to xml in header:
headers.put("Content-Type", "application/xml");
What's that smell? I think this tiny ad may have stepped in something.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
ContentNegotiatingViewResolver
Rest Server Returns HTTP 405 Error
problem in tiles application
Getting error when submitting form using SpringMVC and REST
406 when trying to resolve xml
More...