Status 200 ok giving blank response - spring

I am working on spring cloud project, getting status 200 ok status but the response body is empty for the APIs. Can any one help me to resolve the issue?
Thanks & Regards
Anita PAtil

Status is different from the Response vody. Response Body depends on what you are returning or binding any data to the Response Body. Know about HTTP Response status line, headers and body and the difference between them. The status here Indicates that Server accepted the request or there is an aasociated action method in the server to respond.

Related

Jmeter Response 500 internal server error for request

HI everyone I need a help regarding to fix the 500 internal server error
Please check my below attached requests and correlation and response image
Please tell me if I was wrong in anywhere I keep trying to do the scripts to run and the result was 500 error.
Redirect request:
Https request1:
Data correlation:
Passing parameters:
Sending request details:
Response message:
Looking into Content-Type header of your request it appears that you should be sending a JSON while you're sending parameters in form of name-value pairs
I think you should switch to Body Data tab in the HTTP Request sampler and put your parameters there like:
Also double check your API contract, it might be the case you need to change the method to POST
More information: REST API Testing - How to Do it Right

What is the HTTP status code to return when input data is missing?

I have written a REST API in nodejs.
I want to send HTTP status codes on various events.
For example when data is returned I send HTTP code 200.
What is the status code to return when the input data is missing?
This isn't specific to nodejs. HTTP status codes are general -- you can read about them on wikipedia:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
I think you want client error code 400, which means Bad Request.
Perhaps you should return 404, not found. As mentioned in previous answer, HTTP status codes are general.
A tip: try getting grip on HTTP before starting off web development.

Informatica HTTP Transformation status

I have a mapping with HTTP transformation. How can i get request status code (e.g. 200 (OK) when request is successful or 404 (Not Found) when server is down)?
Thanks in advance.
In case the Status Code is not "200 OK", the record is dropped at the HTTP transformation. The response status code displayed in the session log.
I don't think you can capture the status code inside the mapping using HTTP transformation. This is because, the status comes as a seperate status line instead of regular http header field.

What is the best way to check if http GET response content is valid with?

I want to check that i got all the content and not just a part of it. If the http header is OK, does it mean that all the content is also OK?
So far i have been using Bash and wget command.
Look for status code 200. According the W3's documentation, status code 200 received in response to a GET requests means the request succeeded and the response is and is returned in the response.
Someone could write an API that returns garbage and still sends status code 200. If you are just getting a file/document from a Web server, then the status codes are probably very trustworthy.
If you want to have a look at the response body to check all your content is there you could use tools like Fiddler or IExplorer F12, wireshark. As #ahoffer mentions if status is 200 ok then the server is giving you what you requested.

codeception get request with if-none-match does not return 304

i am using codeception for the code coverage of a REST API. In my current case, i want to test the behaviour of sending a request to receive an ETag-Header for the requested resource and reuse the value of this ETag in a second request on the same resource with the header "If-None-Match" to achieve a 304 response code.
So what I am doing in my Cest-File is:
// send first request, grab etag
$I->sendGET('/myresource');
$I->seeResponseCodeIs(200);
$I->seeHttpHeader('ETag');
$eTag = $I->grabHttpHeader('ETag');
// send second request with header "If-None-Match" containing the etag
$I->haveHttpHeader('If-None-Match', $eTag);
$I->sendGET('/myresource');
$I->seeHttpHeader('ETag');
$I->seeResponseCodeIs(304);
When I execute this test it fails after the second request saying that response code 200 does not match 304.
When I execute the same request with an external tool (HTTP Requester Plugin for Firefox), i get the expected behaviour. What do i have to do to get my tests working? Am i mssing something on the codeception side or may this be a bug?
Any help is appreciated, maybe someone already had this scenario before.
Thanks in advance for your help!

Resources