I'm trying to make a simple HTTP POST request, and I have no idea why the following is failing. I tried following the examples here, and I don't see where I'm going wrong.
Exception
java.lang.NullPointerException
at groovyx.net.http.HTTPBuilder$RequestConfigDelegate.setBody(HTTPBuilder.java:1131)
...
Code
def List<String> se...
When I run my grails application locally under Tomcat, I get no errors. When I deploy my WAR on my remote web server, I get this exception when I try to make an AJAX request that uses HTTPBuilder.
How could this be happening?
...
Dear All:
I am reading here:
http://groovy.codehaus.org/modules/http-builder/doc/get.html
I seem to be able to get
i) XMLSlurper output as parsed by NekoHTML using:
def http = new HTTPBuilder('http://www.google.com')
def html = http.get( path : '/search', query : [q:'Groovy'] )
ii) Raw text using:
http.get( path : '/search',
...
I've created a groovlet that will act as a sort of HTTP proxy. It accepts GET requests and then makes web service calls based on the URL provided in the request.
Here's the code I've got so far:
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0')
import groovyx.net.http.*
import static groovy...
Dear All:
I am doing this (in Groovy):
def cookies=webClient.cookieManager.cookies
def http=new HTTPBuilder("myurl")
http.request(POST) {
def headersCookie=''
cookies.eachWithIndex() { cookie,i->
if (i>0) {
headersCookie+='; '
}
headersCookie+=cookie.getName()+"="+cookie.getValue()
}
headers.'Cookie'=headersCook...
I am trying per instructions here:
http://www.innovation.ch/java/HTTPClient/advanced_info.html
However, if I am using HTTP Builder, the following lines
System.setProperty("HTTPClient.cookies.save","true")
System.setProperty("HTTPClient.cookies.jar","/home/misha/.httpclient_cookies")
do not seem to create a file:
~/.httpclient_cookie...
Ok, this isn't even a question:
import com.gargoylesoftware.htmlunit.HttpMethod
import com.gargoylesoftware.htmlunit.WebClient
import com.gargoylesoftware.htmlunit.WebResponseData
import com.gargoylesoftware.htmlunit.WebResponseImpl
import com.gargoylesoftware.htmlunit.util.Cookie
import com.gargoylesoftware.htmlunit.util.NameValuePair
...
Hi,
i'm trying to use the groovy httpbuilder to make a post to the microsoft exchange webservice (EWS). My problem is, I'm unable to set the proper request content-type. The library seems to have its own mind here.
Does anyone have an idea?
Cheers,
Stephan
Here is my code:
url = "http://exchangeserver/ews/Exchange.asmx"
p_...
Hi
I'm trying to build up a rest Service which provide JSON response.
Yesterday i figured about what is JSONP, why to use it an so and so.
Today i would like to make some test with my new version of my service.
To test it, i use HTTPbuilder. But i can't get it working correctly.
Here is the start of my test:
def client = new RESTClient...