How do you get request error's logs using WizTools REST Client? - api

I'm making GET and POST requests using WizTools REST Client, but I got HTTP 500 errors. I would like to get logs. Any tips?
HTTP Response
HTTP/1.1 500 Internal Server Error

Related

REST API How to generate a 500 Error status when using a Postman Request

I need to test the 500 'internal server error' but Need to test this new API with calls from postman. Does anyone know how to make a call that will trigger it? I'm not talking about setting up a mock or doing it from the dev side. I need to invoke 500 responses by making requests so I can verify that a 500 request is returned from this new server.
The 500 Internal Server Error is internal to your system and you will get it when there is some issue in your code.
If the code doesn't has issues and you just want to get a 500 error status for testing then you can throw an exception like NullPointerException from your code.
the 500 error can be get by not passing necessary parameter in header eg x-api-key and also incorrect data in request as not accepted by server eg name an be Name

Http post method Key significance

I am facing a challenge in sending data to http server through AT command
Condition Given:
"The version of HTTP used should be 1.1 or
higher, HTTP key should be 'logdata' and the HTTP POST method should be
used to send data."
I can't understand how to submit the key, every time I get 400 bad request error.
AT+HTTPSET="URL","http://13.229.232.186:80"

What is the correct HTTP response for requests without percent encoded URI?

Talking about HTTP API/HTTP Web server, what is the HTTP response code that the server should returns in case the client did not apply a URL encoding to requests params. I tried to look into HTTP RFCs but nothing specific or useful regarding that.
If the request is invalid, you can return a 400 Bad Request status.
400 Bad Request
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
(Source)
If you want to send a more informative or specific response, you can provide additional details in the response body.

PUT/POST request in SOAPUI giving 403 forbidden, while same request working fine in rest client Postman

There is no authentication on server side so authentication should not be issue.
URL format: PUT
https://localhost/api/v1/protections?integrationKey=111&userKey=1111&group=111&category=foo
Payload:
{"action":"BLOCK"}
This is working fine in Postman.
In SOAP UI , I am giving input as under:
EndPoint: https://localhost
Resource: /api/v1/protections
Parameters:?integrationKey=111&userKey=1111&group=111&category=foo
in Media type, I am selecting "application/json"
and entering {"action": "BLOCK"} but getting "Wed Jan 20 16:25:27 PST 2016:DEBUG:Receiving response: HTTP/1.1 403 Forbidden
"
Is there any suggestion to get the output in SOAP UI.
Depending on the server where the rest is exposed service generates an HTTP 403, you should verify that server is and thus find the fastest response.
Also try making a GET request from the browser to see if you can answer correctly because problem lock your machine to the server.
As is https, it may be that you lack some certificate set SOAPUI. possibly Postman you use already has configured. Try to check this setting.
In my case, I missed the Header "User-Agent" and "accept". I put in Soap UI and Works.
In Postman, this headers it put automatically.

HTTP Status Code: 401 in GCMDemo

Reference:http://developer.android.com/google/gcm/demo.html
Server 401 when trying to send a message to my android device.
HTTP Status 500 - HTTP Status Code: 401
type Exception report
message HTTP Status Code: 401
description The server encountered an internal error (HTTP Status Code: 401) that prevented it from fulfilling this request.
exception
com.google.android.gcm.server.InvalidRequestException: HTTP Status Code: 401
com.google.android.gcm.server.Sender.sendNoRetry(Sender.java:177)
com.google.android.gcm.server.Sender.send(Sender.java:121)
com.google.android.gcm.demo.server.SendAllMessagesServlet.doPost(SendAllMessagesServ let.java:83)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.
Could anybody tell me how to solve?Thank you!
You should take a look at the GCM docs where it explains the GCM response: http://developer.android.com/google/gcm/gcm.html#response and troubleshooting the 401 error code: http://developer.android.com/google/gcm/gcm.html#auth_error
Description from the docs:
Authentication Error
The sender account that you're trying to use to
send a message couldn't be authenticated. Possible causes are:
Authorization header missing or with invalid syntax.
Invalid project number sent as key.
Key valid but with GCM service disabled.
Request originated from a server not whitelisted in the Server Key IPs.
So I would check to make sure that you are setting you authorization header properly and that you Google Project number is properly setup with GCM and accepting your servers IP.