Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking up a call chain example is obselete in README file #39

Open
PeterYuHautelook opened this issue Nov 13, 2018 · 1 comment · May be fixed by #47
Open

Breaking up a call chain example is obselete in README file #39

PeterYuHautelook opened this issue Nov 13, 2018 · 1 comment · May be fixed by #47

Comments

@PeterYuHautelook
Copy link

        var endpoint1 = new RestAssured()

.Given()
//Optional, set the name of this suite
.Name("JsonIP Test Suite")
//Optional, set the header parameters.
//Defaults will be set to application/json if none is given
.Header("Content-Type", "application/json")
.Header("Accept-Encoding", "gzip,deflate")
.Host("jsonip.com")
.Uri("/endpoint1");

        endpoint1.When().Get().Then().TestBody("test 1", x => x.ip != null).Assert("test 1");

is not compiling and giving me error System.Exception : (application/json; charset=utf-8) not supported

Same for the below modified code from example:
var endpoint1 = new RestAssured()
.Given()
//Optional, set the name of this suite
.Name("JsonIP Test Suite")
//Optional, set the header parameters.
//Defaults will be set to application/json if none is given
.Header("Content-Type", "application/json")
.Header("Accept-Encoding", "gzip,deflate")
.Host("jsonip.com")
.Uri("/endpoint1");

        //Make a copy of the settings from above, but adjust the endpoint.
        var endpoint2 = endpoint1.Clone().Uri("/endpoint2");

        //Do a GET action with the first endpoint configuration
        endpoint2.When().Get().Then().TestBody("test 1", x => x.id != null).Assert("test 1");

        //Do a POST action with the second endpoint configuration
        endpoint2.When().Post().Then().TestBody("test 1", x => x.id != null).Assert("test 1");
@DayneD89
Copy link

The issue is with the example endpoint. Go to jsonip.com/endpoint1 yourself and you'll see that it doesn't return a valid json. I'll fix the example though as there are a couple of things wrong with it and it's a tiny change.

@DayneD89 DayneD89 linked a pull request Aug 13, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants