I'm currently working on my programming skills by doing a application for a website. For now I can sign in to the webpage trough the application. My focus now is to let the user change his/her's profile trough the application and save it to the website. The problem is that nothing is happening on the website and I get no error code or anything.
When I click the save button to save recently changes on the website I get the following header message (By using google chrome f12 -> Network):
firstname: John
lastname:Random
streetAddress:Woodstreet 12
careOfAddress:
zipCode:417 22
city:Woods
country:US
phone:111122000
languageForeignKey:4FCB3B38F96800010003004E
invoiceDeliveryMethod:email
preferredMessageMethod:sms
save_button:
utf8:✓
authenticity_token:+RadnomKey40134128Notes=
My method
public void setUpdatedContactInformation(String cookie, String firstName,
String lastName, String streeAdress, String coAdress,
String zipCode, String city, String country,
String alternativPhone, String language, String deliveryMethod,
String messageMethod, String token) {
try {
Response Jresponse = Jsoup
.connect(ContactInfoURL).cookie("Website-session", cookie)
.data("firstname", firstName, "lastname", lastName,
"streetAddress", streeAdress, "careOfAddress",
coAdress, "zipCode", zipCode, "city", city,
"country", country, "phone", alternativPhone,
"languageForeignKey", language,
"invoiceDeliveryMethod", deliveryMethod,
"preferredMessageMethod", messageMethod,
"authenticity_token", token)
.method(Method.POST)
.execute();
I don't know if token is needed, but I used it anyway. I can fetch the token from before so it's the same as the logged session. Every input that the functions takes is the same as the form, I just changed the firstname to Johnnn to see if it works, but John is not changed on the website.