Rest Assured :- Getting 404 response from Post request created using Pathparam and FormParam

Shweta Jain

I am a newbie to Rest Assured and need your help on the following issue.

I want to trigger a POST request which is as follows:-

Response resp = RestAssured.given().pathParam("build", bulid).
            formParam("file", "https://unsplash.com/photos/Bcv4wZSMtIA").// Cast
            formParam("type", "front").
            formParam("auto_start", false).
            then().post("https://example.com/{build}");

Where build= abc/xyz

Thus. should result in https://example.com/abc/xyz as endpoint and body as:

{   
"file" : "https://unsplash.com/photos/Bcv4wZSMtIA",
"type" : "front",
"auto_start" : false     

}

But when triggered it gives 404, whereas when instead of using pathparam I hardcode the value of build in post request then it works fine.

Can someone please advise what am I doing wrong here.

Shweta Jain

Found out that the url was being encoded when sent as request uri which when disabled using used urlEncodingEnabled(false) resolved my issue.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Matching the Json schema with the response getting from the API in rest-assured

From Dev

Internal Server Error when making POST request using Rest Assured

From Dev

Getting 405 "Method Not Allowed" error using POST with @FormParam (Java web service with Jersey REST)

From Dev

POST request fails (rest-assured test)

From Dev

How to validate nested response using REST Assured?

From Dev

How to use POST method in rest-assured and fetch the value from its response

From Dev

How to use POST method in rest-assured and fetch the value from its response

From Dev

How to extract values from Response Headers and make assertations using Rest Assured?

From Dev

How to frame the rest assured script for a post request based on CURL

From Dev

Unknown output when getting response from POST request

From Dev

Verify integer value in response header using REST-assured

From Dev

Rest-assured. Is it possible to extract value from request json?

From Dev

Rest assured: Size of json response

From Dev

response from post request is empty

From Dev

How do i send JsonObject with nested values as Post request in REST assured

From Dev

Rest Assured - deserialize Response JSON as List<POJO>

From Dev

Rest Assured Framework complete JSON response matching

From Dev

Unable to post a share using Jive REST API - getting 400 Bad Request error

From Dev

REST API POST Response after multiple objects are created?

From Dev

Getting request body from response object

From Dev

Getting Permission Denied response from _request() call

From Dev

getting XML from NSData response of an NSURLSessionDataTask request

From Dev

Empty respond body for post with rest assured

From Java

Getting java.lang.AbstractMethodError when I test using REST Assured

From Dev

how I can use global header request through all tests using rest assured

From Dev

How to get response object from POST request?

From Dev

REST @FormParam is null

From Dev

Flask is not getting any POST data from a request

From Dev

Getting a JSON HTTP POST request from WCF

Related Related

  1. 1

    Matching the Json schema with the response getting from the API in rest-assured

  2. 2

    Internal Server Error when making POST request using Rest Assured

  3. 3

    Getting 405 "Method Not Allowed" error using POST with @FormParam (Java web service with Jersey REST)

  4. 4

    POST request fails (rest-assured test)

  5. 5

    How to validate nested response using REST Assured?

  6. 6

    How to use POST method in rest-assured and fetch the value from its response

  7. 7

    How to use POST method in rest-assured and fetch the value from its response

  8. 8

    How to extract values from Response Headers and make assertations using Rest Assured?

  9. 9

    How to frame the rest assured script for a post request based on CURL

  10. 10

    Unknown output when getting response from POST request

  11. 11

    Verify integer value in response header using REST-assured

  12. 12

    Rest-assured. Is it possible to extract value from request json?

  13. 13

    Rest assured: Size of json response

  14. 14

    response from post request is empty

  15. 15

    How do i send JsonObject with nested values as Post request in REST assured

  16. 16

    Rest Assured - deserialize Response JSON as List<POJO>

  17. 17

    Rest Assured Framework complete JSON response matching

  18. 18

    Unable to post a share using Jive REST API - getting 400 Bad Request error

  19. 19

    REST API POST Response after multiple objects are created?

  20. 20

    Getting request body from response object

  21. 21

    Getting Permission Denied response from _request() call

  22. 22

    getting XML from NSData response of an NSURLSessionDataTask request

  23. 23

    Empty respond body for post with rest assured

  24. 24

    Getting java.lang.AbstractMethodError when I test using REST Assured

  25. 25

    how I can use global header request through all tests using rest assured

  26. 26

    How to get response object from POST request?

  27. 27

    REST @FormParam is null

  28. 28

    Flask is not getting any POST data from a request

  29. 29

    Getting a JSON HTTP POST request from WCF

HotTag

Archive