Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Send a POST to a server, what I need to send? My code is in the message  RSS feed

 
Vinicius Souza
Ranch Hand
Posts: 70
1
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to auto connect to server sending my username and my password. They uses POST method, so I created a code where I verify if I'm connected with a Timer and then try to connect. They used a javascript MD5 function, so I created a JS engine and runned it in my app, it worked, but for some reason it does not work.
This is a small piece of my code, but shows what I need:

What I need to know if I need to send a header or something else.
Thanks!
 
Simon Roberts
Author
Ranch Hand
Posts: 176
9
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must admit I don't really understand what you're doing here (sorry, there are enough Spanish variable names that don't mean anything to me, and , I don't see the definition of the "pegaPagina" method) but MD5 capability is built into Java. There's no need to spawn out to JavaScript.

Did you know that? Do you care? Or is there, perhaps, some special reason to want to use the JS implementation?

Also, as a side note, if you're doing much in terms of handling web requests, you might want to look at JAX-RS (which is the Java EE standard for REST service provision)

But, I might have missed the point entirely; your question asks about sending a header, but I'm not sure what you're driving at.
Cheers,
Simon
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!