I have to make a request to an API with XML:
http://production.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=<CityStateLookupRequest%20USERID="xxxxxxxxxxxx"> <ZipCode ID= "0"> <Zip5>90210</Zip5> </ZipCode> </CityStateLookupRequest>
I'm trying to use Nokogiri to achieve this, but I don't know how to add the USERID="xxxx.." part. This is what I have (incomplete):
def xml_for_initial_request
builder = Nokogiri::XML::Builder.new do |xml|
xml.CityStateLookupRequest.USERIDhowdoIsetthevalue?? {
xml.Zip {
xml.Zip5 '90210'
}
}
end
end