You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.NullPointerException
at com.createsend.util.JerseyClientImpl.handleErrorResponse(JerseyClientImpl.java:363)
at com.createsend.util.JerseyClientImpl.post(JerseyClientImpl.java:207)
at com.createsend.util.JerseyClientImpl.post(JerseyClientImpl.java:195)
at com.createsend.Campaigns.create(Campaigns.java:106)
at Tester.main(Tester.java:24)
What should actually happen is this:
Exception in thread "main" com.createsend.util.exceptions.UnauthorisedException: The CreateSend API responded with the following authentication error 50: Must supply a valid HTTP Basic Authorization header
at com.createsend.util.JerseyClientImpl.handleErrorResponse(JerseyClientImpl.java:363)
at com.createsend.util.JerseyClientImpl.get(JerseyClientImpl.java:148)
at com.createsend.util.JerseyClientImpl.get(JerseyClientImpl.java:133)
at com.createsend.util.JerseyClientImpl.get(JerseyClientImpl.java:107)
at com.createsend.General.getClients(General.java:88)
at Tester.main(Tester.java:31)
The text was updated successfully, but these errors were encountered:
The core of the problem here appears to be a problem with Jersey not including the body of the response when a 401 Unauthorized response is received after issuing a POST request (so it's not specific to creating a campaign). GET requests which respond with a 401 Unauthorized appear to be fine.
The body variable representing the body of the response will be as expected for GET requests which respond with a 401 Unauthorized, but it will be empty for POST requests which respond with a 401 Unauthorized.
/cc @tobio (any experience with Jersey when originally implementing this library would be appreciated)
@jdennes, I didn't run into anything like that. It might be worth checking out the newer versions of Jersey (seems to be up to 1.9) to see if the behaviour's changed?
The following code:
Results in:
What should actually happen is this:
The text was updated successfully, but these errors were encountered: