Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

how to make https post in JavaScript

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello ranchers
I am trying to connect to an url which is on https, i am fine with the http post in java script using XmlHttpRequest, but i am unable to make a https post using the same.
Actually the java script is a part of the Phonegap which is no way different from how the java script being handled in a browser.
One more question i have is, how to provide the security certificate in order to make the https communication.
Can any one please provide me with the piece of code to make the https post.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not make XMLHttpRequest calls from http to https and https to http because of the same origin policy.

Eric
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Eric

You can not make XMLHttpRequest calls from http to https and https to http because of the same origin policy.


I am not making the call from http to https or vice versa, my requests and responses are to https only.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have noticed like my post has been edited, i am sorry if some thing what i mean to say didn't make any sense but the content of the post which has been modified is

Bear Bibeault edited it as wrote: but i am unable to make a http post using the same.


but i am facing the problem in making https post, i am not sure whether XmlHttpRequest is to be used for a https post, please correct me if i am wrong, but what i need is to make a https post, so i restored the content of the post i made here as

but i am unable to make a https post using the same.

 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there error messages? Using a tool such as Fiddler do you see the call go out?

Eric
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic