Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your <code>Content-Type</code> header is invalid (see spec <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17" rel="nofollow">14.17 Content-Type</a>). Based on you JAX-RS resource you should use <code>application/json</code> as <code>Content-Type</code> (without <code>application/x-www-form-urlencoded</code>):</p> <pre><code>$http({ method: 'POST', data: $scope.Patient, url:'/ManagePatient/AddPatient', headers: {'Content-Type':'application/json'} }); </code></pre> <h3>EDIT 1:</h3> <p>If you want to see requests that are coming to your server you can register <a href="https://jersey.java.net/apidocs/latest/jersey/org/glassfish/jersey/filter/LoggingFilter.html" rel="nofollow">LoggingFilter</a> and it will show you some useful information. You can turn it on in:</p> <p><code>web.xml</code> (add it to the JAX-RS servlet definition):</p> <pre><code>&lt;init-param&gt; &lt;param-name&gt;jersey.config.server.provider.classnames&lt;/param-name&gt; &lt;param-value&gt;org.glassfish.jersey.filter.LoggingFilter&lt;/param-value&gt; &lt;/init-param&gt; </code></pre> <p><code>Application</code> extension:</p> <pre><code>public class MyApplication extends Application { @Override public Set&lt;Class&lt;?&gt;&gt; getClasses() { return new HashSet&lt;Class&lt;?&gt;&gt;() {{ // Add your resources. add(HelloWorldResource.class); // Add LoggingFilter. add(LoggingFilter.class); }}; } } </code></pre> <p><code>ResourceConfig</code> instance (demonstrating also outputting the entity here):</p> <pre><code>public class MyApplication extends ResourceConfig { public MyApplication() { // Resources - add your package name here to enable package scanning. packages(...); // Enable LoggingFilter &amp; output entity. registerInstances(new LoggingFilter(Logger.getLogger(MyApplication.class.getName()), true)); } } </code></pre> <h3>EDIT 2:</h3> <p>Jersey 2.x does not support <code>application/json</code> media type out of the box - you need to add one of the JSON modules to your classpath (see <a href="https://jersey.java.net/documentation/2.0/user-guide.html#json" rel="nofollow">JSON</a> section in users guide), for example:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt; &lt;artifactId&gt;jersey-media-moxy&lt;/artifactId&gt; &lt;version&gt;2.0&lt;/version&gt; &lt;/dependency&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload